diff --git a/apps/openmw-mp/Script/Functions/Stats.cpp b/apps/openmw-mp/Script/Functions/Stats.cpp index b6ba7ea3e..22b6b3ed3 100644 --- a/apps/openmw-mp/Script/Functions/Stats.cpp +++ b/apps/openmw-mp/Script/Functions/Stats.cpp @@ -339,7 +339,7 @@ void ScriptFunctions::SetSkill(unsigned short pid, unsigned short skill, int val player->NpcStats()->mSkills[skill].mBase = value; - DEBUG_PRINTF("SetSkill(%d, %d, %d)\n", pid, skill, value); + //DEBUG_PRINTF("SetSkill(%d, %d, %d)\n", pid, skill, value); mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_SKILL)->Send(player, false); mwmp::Networking::Get().GetController()->GetPacket(ID_GAME_SKILL)->Send(player, true); diff --git a/apps/openmw/mwmp/DedicatedPlayer.cpp b/apps/openmw/mwmp/DedicatedPlayer.cpp index 41c90f961..05cedb9dd 100644 --- a/apps/openmw/mwmp/DedicatedPlayer.cpp +++ b/apps/openmw/mwmp/DedicatedPlayer.cpp @@ -404,6 +404,13 @@ void DedicatedPlayer::updateCell() cellStore = world->getExterior(cell.mCellId.mIndex.mX, cell.mCellId.mIndex.mY); else cellStore = world->getInterior(cell.mName); + + // tes3mp debug start + printf("Server says %s (%s) moved to %s\n", + ptr.getBase()->mRef.getRefId().c_str(), + this->Npc()->mName.c_str(), + cellStore->getCell()->getDescription().c_str()); + // tes3mp debug end // Allow this player's reference to move across a cell now that // a manual cell update has been called diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index 00b27cd9e..5a6ac6042 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -342,6 +342,12 @@ void LocalPlayer::updateCell(bool forceUpdate) if (shouldUpdate) { + // tes3mp debug start + printf("Telling server I moved from %s to %s\n", + GetCell()->getDescription().c_str(), + _cell->getDescription().c_str()); + // tes3mp debug end + (*GetCell()) = *_cell; isExterior = _cell->isExterior(); diff --git a/apps/openmw/mwmp/Networking.cpp b/apps/openmw/mwmp/Networking.cpp index e7284c1c6..68478b31e 100644 --- a/apps/openmw/mwmp/Networking.cpp +++ b/apps/openmw/mwmp/Networking.cpp @@ -280,7 +280,7 @@ void Networking::ReciveMessage(RakNet::Packet *packet) { myPacket->Packet(&bsIn, pl, false); - cout << "Player: " << pl->Npc()->mName << " pressed: " << (pl->GetAttack()->pressed == 1) << endl; + //cout << "Player: " << pl->Npc()->mName << " pressed: " << (pl->GetAttack()->pressed == 1) << endl; if(pl->GetAttack()->pressed == 0) { cout << "success: " << (pl->GetAttack()->success == 1); @@ -525,7 +525,7 @@ void Networking::ReciveMessage(RakNet::Packet *packet) { skillValue.readState(__pl->NpcStats()->mSkills[i]); __pl_ptr.getClass().getNpcStats(__pl_ptr).setSkill(i, skillValue); - printf("skill %d, value %d\n", i, skillValue.getBase()); + //printf("skill %d, value %d\n", i, skillValue.getBase()); } break; diff --git a/apps/openmw/mwworld/cellstore.cpp b/apps/openmw/mwworld/cellstore.cpp index f1dfa1639..f418f8bad 100644 --- a/apps/openmw/mwworld/cellstore.cpp +++ b/apps/openmw/mwworld/cellstore.cpp @@ -1,5 +1,7 @@ #include "cellstore.hpp" +#include + #include #include @@ -214,6 +216,18 @@ namespace MWWorld if (found != mMovedToAnotherCell.end()) { // A cell we had previously moved an object to is returning it to us. + + // tes3mp debug start + if (found->second != from) { + + printf("Storage: %s owned %s which it gave to %s which isn't %s therefore CRASH\n", + this->getCell()->getDescription().c_str(), + object.getBase()->mRef.getRefId().c_str(), + found->second->getCell()->getDescription().c_str(), + from->getCell()->getDescription().c_str()); + } + // tes3mp debug end + assert (found->second == from); mMovedToAnotherCell.erase(found); } @@ -269,6 +283,14 @@ namespace MWWorld // Now that object is back to its rightful owner, we can move it if (cellToMoveTo != originalCell) { + // tes3mp debug start + printf("Storage: %s's original cell %s gives it from %s to %s\n", + object.getBase()->mRef.getRefId().c_str(), + originalCell->getCell()->getDescription().c_str(), + this->getCell()->getDescription().c_str(), + cellToMoveTo->getCell()->getDescription().c_str()); + // tes3mp debug end + originalCell->moveTo(object, cellToMoveTo); } diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 3ab9aa665..5e3779f80 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1,5 +1,7 @@ #include "worldimp.hpp" +#include + #include #include @@ -1140,6 +1142,17 @@ namespace MWWorld bool isPlayer = ptr == mPlayer->getPlayer(); bool haveToMove = isPlayer || (currCell && mWorldScene->isCellActive(*currCell)); MWWorld::Ptr newPtr = ptr; + + // tes3mp debug start + if (currCell != newCell) { + + printf("Tick: %s was %s move from %s to %s\n", + ptr.getBase()->mRef.getRefId().c_str(), + ptr.getBase()->canChangeCell ? "allowed" : "denied", + currCell->getCell()->getDescription().c_str(), + newCell->getCell()->getDescription().c_str()); + } + // tes3mp debug end if (currCell != newCell && ptr.getBase()->canChangeCell) {