diff --git a/apps/openmw/mwmp/DedicatedPlayer.cpp b/apps/openmw/mwmp/DedicatedPlayer.cpp index a420b6263..012796673 100644 --- a/apps/openmw/mwmp/DedicatedPlayer.cpp +++ b/apps/openmw/mwmp/DedicatedPlayer.cpp @@ -117,7 +117,7 @@ void DedicatedPlayer::move(float dt) world->moveObject(ptr, position.pos[0], position.pos[1], position.pos[2]); } - world->rotateObject(ptr, position.rot[0], position.rot[1], position.rot[2]); + world->rotateObject(ptr, position.rot[0], 0, position.rot[2]); MWMechanics::Movement *move = &ptr.getClass().getMovementSettings(ptr); move->mPosition[0] = direction.pos[0]; diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index c8747797c..3f0df37d8 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -321,19 +321,24 @@ void LocalPlayer::updatePosition(bool forceUpdate) static bool posWasChanged = false; static bool isJumping = false; static bool sentJumpEnd = true; + static float oldRot[2] = {0}; + + position = player.getRefData().getPosition(); bool posIsChanging = (direction.pos[0] != 0 || direction.pos[1] != 0 || direction.pos[2] != 0 || - position.rot[0] != 0 || position.rot[1] != 0 || position.rot[2] != 0); + position.rot[0] != oldRot[0] || position.rot[2] != oldRot[1]); if (forceUpdate || posIsChanging || posWasChanged) { + + oldRot[0] = position.rot[0]; + oldRot[1] = position.rot[2]; + posWasChanged = posIsChanging; if (!isJumping && !world->isOnGround(player) && !world->isFlying(player)) isJumping = true; - position = player.getRefData().getPosition(); - getNetworking()->getPlayerPacket(ID_PLAYER_POSITION)->setPlayer(this); getNetworking()->getPlayerPacket(ID_PLAYER_POSITION)->Send(); }