mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-29 08:00:56 -04:00
[Client] Force position updates for players in animations
This commit is contained in:
parent
be25decee2
commit
2ca4017371
@ -67,6 +67,7 @@ LocalPlayer::LocalPlayer()
|
||||
|
||||
diedSinceArrestAttempt = false;
|
||||
isReceivingQuickKeys = false;
|
||||
isPlayingAnimation = false;
|
||||
}
|
||||
|
||||
LocalPlayer::~LocalPlayer()
|
||||
@ -339,6 +340,16 @@ void LocalPlayer::updatePosition(bool forceUpdate)
|
||||
bool posIsChanging = (direction.pos[0] != 0 || direction.pos[1] != 0 ||
|
||||
position.rot[0] != oldRot[0] || position.rot[2] != oldRot[1]);
|
||||
|
||||
// Animations can change a player's position without actually creating directional movement,
|
||||
// so update positions accordingly
|
||||
if (!posIsChanging && isPlayingAnimation)
|
||||
{
|
||||
if (MWBase::Environment::get().getMechanicsManager()->checkAnimationPlaying(ptrPlayer, animation.groupname))
|
||||
posIsChanging = true;
|
||||
else
|
||||
isPlayingAnimation = false;
|
||||
}
|
||||
|
||||
if (forceUpdate || posIsChanging || posWasChanged)
|
||||
{
|
||||
oldRot[0] = position.rot[0];
|
||||
@ -1452,6 +1463,8 @@ void LocalPlayer::playAnimation()
|
||||
{
|
||||
MWBase::Environment::get().getMechanicsManager()->playAnimationGroup(getPlayerPtr(),
|
||||
animation.groupname, animation.mode, animation.count, animation.persist);
|
||||
|
||||
isPlayingAnimation = true;
|
||||
}
|
||||
|
||||
void LocalPlayer::playSpeech()
|
||||
|
@ -292,6 +292,7 @@ namespace mwmp
|
||||
|
||||
bool diedSinceArrestAttempt;
|
||||
bool isReceivingQuickKeys;
|
||||
bool isPlayingAnimation;
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user