forked from teamnwah/openmw-tes3coop
[Client] Assign LocalActor movement settings before rotations get reset
This commit is contained in:
parent
1fb11dafef
commit
d2178e5414
2 changed files with 23 additions and 22 deletions
|
@ -1661,6 +1661,26 @@ void CharacterController::update(float duration)
|
||||||
|
|
||||||
if(mHitState != CharState_None && mJumpState == JumpState_None)
|
if(mHitState != CharState_None && mJumpState == JumpState_None)
|
||||||
vec = osg::Vec3f(0.f, 0.f, 0.f);
|
vec = osg::Vec3f(0.f, 0.f, 0.f);
|
||||||
|
|
||||||
|
/*
|
||||||
|
Start of tes3mp addition
|
||||||
|
|
||||||
|
Character movement setting rotations get reset here, so we have to assign movement
|
||||||
|
settings to a relevant LocalActor now
|
||||||
|
*/
|
||||||
|
if (isLocalActor)
|
||||||
|
{
|
||||||
|
localActor->direction.pos[0] = cls.getMovementSettings(mPtr).mPosition[0];
|
||||||
|
localActor->direction.pos[1] = cls.getMovementSettings(mPtr).mPosition[1];
|
||||||
|
localActor->direction.pos[2] = cls.getMovementSettings(mPtr).mPosition[2];
|
||||||
|
localActor->direction.rot[0] = cls.getMovementSettings(mPtr).mRotation[0];
|
||||||
|
localActor->direction.rot[1] = cls.getMovementSettings(mPtr).mRotation[1];
|
||||||
|
localActor->direction.rot[2] = cls.getMovementSettings(mPtr).mRotation[2];
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
End of tes3mp addition
|
||||||
|
*/
|
||||||
|
|
||||||
osg::Vec3f rot = cls.getRotationVector(mPtr);
|
osg::Vec3f rot = cls.getRotationVector(mPtr);
|
||||||
|
|
||||||
speed = cls.getSpeed(mPtr);
|
speed = cls.getSpeed(mPtr);
|
||||||
|
@ -1947,25 +1967,6 @@ void CharacterController::update(float duration)
|
||||||
|
|
||||||
movement = vec;
|
movement = vec;
|
||||||
|
|
||||||
/*
|
|
||||||
Start of tes3mp addition
|
|
||||||
|
|
||||||
Character movement setting positions get reset here, so we have to assign them to a
|
|
||||||
relevant LocalActor now
|
|
||||||
*/
|
|
||||||
if (isLocalActor)
|
|
||||||
{
|
|
||||||
localActor->direction.pos[0] = cls.getMovementSettings(mPtr).mPosition[0];
|
|
||||||
localActor->direction.pos[1] = cls.getMovementSettings(mPtr).mPosition[1];
|
|
||||||
localActor->direction.pos[2] = cls.getMovementSettings(mPtr).mPosition[2];
|
|
||||||
localActor->direction.rot[0] = cls.getMovementSettings(mPtr).mRotation[0];
|
|
||||||
localActor->direction.rot[1] = cls.getMovementSettings(mPtr).mRotation[1];
|
|
||||||
localActor->direction.rot[2] = cls.getMovementSettings(mPtr).mRotation[2];
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
End of tes3mp addition
|
|
||||||
*/
|
|
||||||
|
|
||||||
cls.getMovementSettings(mPtr).mPosition[0] = cls.getMovementSettings(mPtr).mPosition[1] = 0;
|
cls.getMovementSettings(mPtr).mPosition[0] = cls.getMovementSettings(mPtr).mPosition[1] = 0;
|
||||||
|
|
||||||
// Can't reset jump state (mPosition[2]) here; we don't know for sure whether the PhysicSystem will actually handle it in this frame
|
// Can't reset jump state (mPosition[2]) here; we don't know for sure whether the PhysicSystem will actually handle it in this frame
|
||||||
|
|
|
@ -172,7 +172,7 @@ void LocalActor::setPtr(const MWWorld::Ptr& newPtr)
|
||||||
mpNum = ptr.getCellRef().getMpNum();
|
mpNum = ptr.getCellRef().getMpNum();
|
||||||
|
|
||||||
lastDrawState = ptr.getClass().getNpcStats(ptr).getDrawState();
|
lastDrawState = ptr.getClass().getNpcStats(ptr).getDrawState();
|
||||||
oldHealth = *(&ptr.getClass().getCreatureStats(ptr).getHealth());
|
oldHealth = ptr.getClass().getCreatureStats(ptr).getHealth();
|
||||||
oldMagicka = *(&ptr.getClass().getCreatureStats(ptr).getMagicka());
|
oldMagicka = ptr.getClass().getCreatureStats(ptr).getMagicka();
|
||||||
oldFatigue = *(&ptr.getClass().getCreatureStats(ptr).getFatigue());
|
oldFatigue = ptr.getClass().getCreatureStats(ptr).getFatigue();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue