diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index 838d8bf44..6a4ce15fc 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -139,6 +139,8 @@ bool LocalPlayer::charGenThread() getNetworking()->getPlayerPacket(ID_GAME_CHARGEN)->Send(this); } + sendCellStates(); + // Set the last stage variable to 0 to indicate that CharGen is finished charGenStage.end = 0; } @@ -1003,6 +1005,7 @@ void LocalPlayer::sendSpellbook() void LocalPlayer::sendCellStates() { Main::get().getNetworking()->getPlayerPacket(ID_PLAYER_CELL_STATE)->Send(this); + } void LocalPlayer::sendSpellAddition(std::string id) diff --git a/apps/openmw/mwmp/Networking.cpp b/apps/openmw/mwmp/Networking.cpp index 8e06ca6ea..6d461605a 100644 --- a/apps/openmw/mwmp/Networking.cpp +++ b/apps/openmw/mwmp/Networking.cpp @@ -530,6 +530,12 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) } case ID_PLAYER_CELL_STATE: { + if (guid == myGuid) + { + if (packet->length == myPacket->headerSize()) + getLocalPlayer()->sendCellStates(); + } + break; } case ID_GAME_DRAWSTATE: diff --git a/apps/openmw/mwworld/scene.cpp b/apps/openmw/mwworld/scene.cpp index 8749607fa..3c05e313e 100644 --- a/apps/openmw/mwworld/scene.cpp +++ b/apps/openmw/mwworld/scene.cpp @@ -354,9 +354,6 @@ namespace MWWorld void Scene::changeCellGrid (int X, int Y, bool changeEvent) { - // Added by tes3mp - mwmp::Main::get().getLocalPlayer()->clearCellStates(); - Loading::Listener* loadingListener = MWBase::Environment::get().getWindowManager()->getLoadingScreen(); Loading::ScopedLoad load(loadingListener); @@ -436,7 +433,10 @@ namespace MWWorld // Added by tes3mp if (mwmp::Main::get().getLocalPlayer()->hasFinishedCharGen()) + { mwmp::Main::get().getLocalPlayer()->sendCellStates(); + mwmp::Main::get().getLocalPlayer()->clearCellStates(); + } CellStore* current = MWBase::Environment::get().getWorld()->getExterior(X,Y); MWBase::Environment::get().getWindowManager()->changeCell(current); @@ -518,9 +518,6 @@ namespace MWWorld void Scene::changeToInteriorCell (const std::string& cellName, const ESM::Position& position, bool adjustPlayerPos, bool changeEvent) { - // Added by tes3mp - mwmp::Main::get().getLocalPlayer()->clearCellStates(); - CellStore *cell = MWBase::Environment::get().getWorld()->getInterior(cellName); bool loadcell = (mCurrentCell == NULL); if(!loadcell) @@ -570,7 +567,10 @@ namespace MWWorld // Added by tes3mp if (mwmp::Main::get().getLocalPlayer()->hasFinishedCharGen()) + { mwmp::Main::get().getLocalPlayer()->sendCellStates(); + mwmp::Main::get().getLocalPlayer()->clearCellStates(); + } changePlayerCell(cell, position, adjustPlayerPos);