diff --git a/apps/openmw/mwmp/DedicatedPlayer.cpp b/apps/openmw/mwmp/DedicatedPlayer.cpp index 870feaeda..eff53668b 100644 --- a/apps/openmw/mwmp/DedicatedPlayer.cpp +++ b/apps/openmw/mwmp/DedicatedPlayer.cpp @@ -25,7 +25,7 @@ using namespace mwmp; using namespace std; -std::map Players::players; +std::map Players::players; DedicatedPlayer::DedicatedPlayer(RakNet::RakNetGUID guid) : BasePlayer(guid) { @@ -51,7 +51,7 @@ void Players::createPlayer(RakNet::RakNetGUID guid) MWWorld::Ptr player = world->getPlayerPtr(); ESM::NPC npc = *player.get()->mBase; - DedicatedPlayer *dedicPlayer = players[guid.g]; + DedicatedPlayer *dedicPlayer = players[guid]; npc.mRace = dedicPlayer->Npc()->mRace; npc.mHead = dedicPlayer->Npc()->mHead; @@ -95,7 +95,7 @@ void Players::createPlayer(RakNet::RakNetGUID guid) dedicPlayer->ptr.getBase()->canChangeCell = true; dedicPlayer->updatePtr(world->moveObject(dedicPlayer->ptr, cellStore, newPos.pos[0], newPos.pos[1], newPos.pos[2])); - npc.mId = players[guid.g]->ptr.get()->mBase->mId; + npc.mId = players[guid]->ptr.get()->mBase->mId; MWWorld::ESMStore *store = const_cast(&world->getStore()); MWWorld::Store *esm_store = const_cast *> (&store->get()); @@ -112,41 +112,41 @@ void Players::createPlayer(RakNet::RakNetGUID guid) dedicPlayer->guid = guid; dedicPlayer->state = 2; - world->enable(players[guid.g]->ptr); + world->enable(players[guid]->ptr); } void Players::cleanUp() { - for (std::map ::iterator it = players.begin(); it != players.end(); it++) + for (std::map ::iterator it = players.begin(); it != players.end(); it++) delete it->second; } void Players::disconnectPlayer(RakNet::RakNetGUID guid) { - if (players[guid.g]->state > 1) + if (players[guid]->state > 1) { - players[guid.g]->state = 1; + players[guid]->state = 1; // Remove player's marker - players[guid.g]->setMarkerState(false); + players[guid]->setMarkerState(false); MWBase::World *world = MWBase::Environment::get().getWorld(); - world->disable(players[guid.g]->getPtr()); + world->disable(players[guid]->getPtr()); // Move player to ToddTest ESM::Position newPos; world->findInteriorPosition("ToddTest", newPos); MWWorld::CellStore *store = world->getInterior("ToddTest"); - players[guid.g]->getPtr().getBase()->canChangeCell = true; - world->moveObject(players[guid.g]->getPtr(), store, newPos.pos[0], newPos.pos[1], newPos.pos[2]); + players[guid]->getPtr().getBase()->canChangeCell = true; + world->moveObject(players[guid]->getPtr(), store, newPos.pos[0], newPos.pos[1], newPos.pos[2]); } } DedicatedPlayer *Players::getPlayer(RakNet::RakNetGUID guid) { - return players[guid.g]; + return players[guid]; } MWWorld::Ptr DedicatedPlayer::getLiveCellPtr() @@ -221,7 +221,7 @@ void DedicatedPlayer::move(float dt) void Players::update(float dt) { - for (std::map ::iterator it = players.begin(); it != players.end(); it++) + for (std::map ::iterator it = players.begin(); it != players.end(); it++) { DedicatedPlayer *pl = it->second; if (pl == 0) continue; @@ -281,9 +281,9 @@ DedicatedPlayer *Players::newPlayer(RakNet::RakNetGUID guid) LOG_APPEND(Log::LOG_INFO, "- Creating new DedicatedPlayer with guid %lu", guid.g); - players[guid.g] = new DedicatedPlayer(guid); - players[guid.g]->state = 0; - return players[guid.g]; + players[guid] = new DedicatedPlayer(guid); + players[guid]->state = 0; + return players[guid]; } void DedicatedPlayer::updateEquipment() @@ -396,7 +396,7 @@ const std::string DedicatedPlayer::getAnim() DedicatedPlayer *Players::getPlayer(const MWWorld::Ptr &ptr) { - std::map ::iterator it = players.begin(); + std::map ::iterator it = players.begin(); for (; it != players.end(); it++) { diff --git a/apps/openmw/mwmp/DedicatedPlayer.hpp b/apps/openmw/mwmp/DedicatedPlayer.hpp index f014b56db..f9606f279 100644 --- a/apps/openmw/mwmp/DedicatedPlayer.hpp +++ b/apps/openmw/mwmp/DedicatedPlayer.hpp @@ -34,7 +34,7 @@ namespace mwmp static DedicatedPlayer *getPlayer(const MWWorld::Ptr &ptr); static void update(float dt); private: - static std::map players; + static std::map players; }; class DedicatedPlayer : public BasePlayer