From 01af4f3bbcc4e7dcd25c758667d84414b5ce6cc5 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Mon, 26 Sep 2016 17:00:09 +0300 Subject: [PATCH] Update position before sending cell packet --- apps/openmw-mp/Script/Functions/Translocations.cpp | 1 - apps/openmw/mwmp/LocalPlayer.cpp | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/openmw-mp/Script/Functions/Translocations.cpp b/apps/openmw-mp/Script/Functions/Translocations.cpp index 459a7afb7..704801ef2 100644 --- a/apps/openmw-mp/Script/Functions/Translocations.cpp +++ b/apps/openmw-mp/Script/Functions/Translocations.cpp @@ -86,7 +86,6 @@ const char* TranslocationFunctions::GetCell(unsigned short pid) noexcept Player *player; GET_PLAYER(pid, player, 0); - return player->GetCell()->mName.c_str(); } diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index a8c387c00..d7e0a6fef 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -438,12 +438,13 @@ void LocalPlayer::updateCell(bool forceUpdate) (*GetCell()) = *_cell; isExterior = _cell->isExterior(); + + // Make sure the position is updated before a cell packet is sent + updatePosition(true); RakNet::BitStream bs; GetNetworking()->GetPacket((RakNet::MessageID) ID_GAME_CELL)->Packet(&bs, this, true); GetNetworking()->SendData(&bs); - - updatePosition(true); } }