From 53855639727a3b6c25769c6f993e2d984662a8ac Mon Sep 17 00:00:00 2001 From: David Cernat Date: Wed, 24 Aug 2016 02:53:39 +0300 Subject: [PATCH] Let players inform others about Lua script-induced cell & pos changes --- apps/openmw-mp/Script/Functions/Translocations.cpp | 4 ---- apps/openmw/mwmp/LocalPlayer.cpp | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/openmw-mp/Script/Functions/Translocations.cpp b/apps/openmw-mp/Script/Functions/Translocations.cpp index 40c623a93..78d5f0ea0 100644 --- a/apps/openmw-mp/Script/Functions/Translocations.cpp +++ b/apps/openmw-mp/Script/Functions/Translocations.cpp @@ -58,7 +58,6 @@ void ScriptFunctions::SetPos(unsigned short pid, double x, double y, double z) n player->Position()->pos[2] = z; mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_UPDATE_POS)->Send(player, false); - mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_UPDATE_POS)->Send(player, true); } void ScriptFunctions::SetCell(unsigned short pid, const char *name) noexcept @@ -80,7 +79,6 @@ void ScriptFunctions::SetCell(unsigned short pid, const char *name) noexcept cout << " in to cell \"" << player->GetCell()->mName << "\"" << endl; mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_CELL)->Send(player, false); - mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_CELL)->Send(player, true); } const char* ScriptFunctions::GetCell(unsigned short pid) noexcept @@ -109,7 +107,6 @@ void ScriptFunctions::SetExterior(unsigned short pid, int x, int y) noexcept player->GetCell()->mCellId.mIndex.mY = y; mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_CELL)->Send(player, false); - mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_CELL)->Send(player, true); } int ScriptFunctions::GetExteriorX(unsigned short pid) noexcept @@ -182,5 +179,4 @@ void ScriptFunctions::SetAngle(unsigned short pid, double x, double y, double z) player->Position()->rot[2] = z; mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_UPDATE_POS)->Send(player, false); - mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_UPDATE_POS)->Send(player, true); } diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index 776ce93ff..89a123a99 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -180,6 +180,8 @@ void LocalPlayer::setPosition() world->getPlayer().setTeleported(true); world->moveObject(player, Position()->pos[0], Position()->pos[1], Position()->pos[2]); world->rotateObject(player, Position()->rot[0], Position()->rot[1], Position()->rot[2]); + + updatePosition(true); } void LocalPlayer::setCell()