From 6cd959fac86b2caf6a2167cca7c08dab246730eb Mon Sep 17 00:00:00 2001 From: David Cernat Date: Wed, 16 Nov 2016 17:43:58 +0200 Subject: [PATCH] Rename BasePlayer's GetCell() into getCell() --- apps/openmw-mp/Networking.cpp | 2 +- .../Script/Functions/Translocations.cpp | 26 +++++++++---------- apps/openmw/mwmp/GUIController.cpp | 4 +-- apps/openmw/mwmp/LocalPlayer.cpp | 22 ++++++++-------- apps/openmw/mwmp/Networking.cpp | 2 +- components/openmw-mp/Base/BasePlayer.hpp | 2 +- .../openmw-mp/Packets/Player/PacketCell.cpp | 8 +++--- 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index 97cfa23ce..0330b7c80 100644 --- a/apps/openmw-mp/Networking.cpp +++ b/apps/openmw-mp/Networking.cpp @@ -157,7 +157,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) myPacket->Read(player); LOG_APPEND(Log::LOG_INFO, "- Moved to %s", - player->GetCell()->getDescription().c_str()); + player->getCell()->getDescription().c_str()); myPacket->Send(player, true); //send to other clients Script::Call(player->getId()); diff --git a/apps/openmw-mp/Script/Functions/Translocations.cpp b/apps/openmw-mp/Script/Functions/Translocations.cpp index 706fdeb43..eca92a15d 100644 --- a/apps/openmw-mp/Script/Functions/Translocations.cpp +++ b/apps/openmw-mp/Script/Functions/Translocations.cpp @@ -112,7 +112,7 @@ const char* TranslocationFunctions::getCell(unsigned short pid) noexcept Player *player; GET_PLAYER(pid, player, 0); - return player->GetCell()->mName.c_str(); + return player->getCell()->mName.c_str(); } void TranslocationFunctions::setCell(unsigned short pid, const char *name) noexcept @@ -122,17 +122,17 @@ void TranslocationFunctions::setCell(unsigned short pid, const char *name) noexc LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Script is moving %s from %s to %s", player->Npc()->mName.c_str(), - player->GetCell()->getDescription().c_str(), + player->getCell()->getDescription().c_str(), name); // If the player is currently in an exterior, turn on the interior flag // from the cell so the player doesn't get teleported to their exterior // grid position (which we haven't changed) - if (player->GetCell()->isExterior()) { - player->GetCell()->mData.mFlags |= ESM::Cell::Interior; + if (player->getCell()->isExterior()) { + player->getCell()->mData.mFlags |= ESM::Cell::Interior; } - player->GetCell()->mName = name; + player->getCell()->mName = name; } void TranslocationFunctions::setExterior(unsigned short pid, int x, int y) noexcept @@ -142,32 +142,32 @@ void TranslocationFunctions::setExterior(unsigned short pid, int x, int y) noexc LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Script is moving %s from %s to %i,%i", player->Npc()->mName.c_str(), - player->GetCell()->getDescription().c_str(), + player->getCell()->getDescription().c_str(), x, y); // If the player is currently in an interior, turn off the interior flag // from the cell - if (!player->GetCell()->isExterior()) { - player->GetCell()->mData.mFlags &= ~ESM::Cell::Interior; + if (!player->getCell()->isExterior()) { + player->getCell()->mData.mFlags &= ~ESM::Cell::Interior; } - player->GetCell()->mData.mX = x; - player->GetCell()->mData.mY = y; + player->getCell()->mData.mX = x; + player->getCell()->mData.mY = y; } int TranslocationFunctions::getExteriorX(unsigned short pid) noexcept { Player *player; GET_PLAYER(pid, player,0); - return player->GetCell()->mData.mX; + return player->getCell()->mData.mX; } int TranslocationFunctions::getExteriorY(unsigned short pid) noexcept { Player *player; GET_PLAYER(pid, player,0); - return player->GetCell()->mData.mY; + return player->getCell()->mData.mY; } bool TranslocationFunctions::isInExterior(unsigned short pid) noexcept @@ -175,7 +175,7 @@ bool TranslocationFunctions::isInExterior(unsigned short pid) noexcept Player *player; GET_PLAYER(pid, player, false); - return player->GetCell()->isExterior(); + return player->getCell()->isExterior(); } void TranslocationFunctions::sendPos(unsigned short pid) noexcept diff --git a/apps/openmw/mwmp/GUIController.cpp b/apps/openmw/mwmp/GUIController.cpp index e9238568e..cebb8b674 100644 --- a/apps/openmw/mwmp/GUIController.cpp +++ b/apps/openmw/mwmp/GUIController.cpp @@ -268,9 +268,9 @@ ESM::CustomMarker mwmp::GUIController::CreateMarker(const RakNet::RakNetGUID &gu mEditingMarker.mNote = player->Npc()->mName; - const ESM::Cell *ptrCell = player->GetCell(); + const ESM::Cell *ptrCell = player->getCell(); - mEditingMarker.mCell = player->GetCell()->mCellId; + mEditingMarker.mCell = player->getCell()->mCellId; mEditingMarker.mWorldX = player->Position()->pos[0]; mEditingMarker.mWorldY = player->Position()->pos[1]; diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index 19bbee01d..c76e7b07e 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -312,17 +312,17 @@ void LocalPlayer::updateCell(bool forceUpdate) { shouldUpdate = true; } - else if (!Misc::StringUtils::ciEqual(ptrCell->mName, GetCell()->mName)) + else if (!Misc::StringUtils::ciEqual(ptrCell->mName, getCell()->mName)) { shouldUpdate = true; } else if (ptrCell->isExterior()) { - if (ptrCell->mData.mX != GetCell()->mData.mX) + if (ptrCell->mData.mX != getCell()->mData.mX) { shouldUpdate = true; } - else if (ptrCell->mData.mY != GetCell()->mData.mY) + else if (ptrCell->mData.mY != getCell()->mData.mY) { shouldUpdate = true; } @@ -333,10 +333,10 @@ void LocalPlayer::updateCell(bool forceUpdate) LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "%s", "Sending ID_GAME_CELL to server"); LOG_APPEND(Log::LOG_INFO, "- Moved from %s to %s", - GetCell()->getDescription().c_str(), + getCell()->getDescription().c_str(), ptrCell->getDescription().c_str()); - (*GetCell()) = *ptrCell; + (*getCell()) = *ptrCell; // Make sure the position is updated before a cell packet is sent, or else // cell change events in server scripts will have the wrong player position @@ -713,10 +713,10 @@ void LocalPlayer::setCell() world->getPlayer().setTeleported(true); - int x = GetCell()->mData.mX; - int y = GetCell()->mData.mY; + int x = getCell()->mData.mX; + int y = getCell()->mData.mY; - if (GetCell()->isExterior()) + if (getCell()->isExterior()) { world->indexToPosition(x, y, pos.pos[0], pos.pos[1], true); pos.pos[2] = 0; @@ -726,7 +726,7 @@ void LocalPlayer::setCell() world->changeToExteriorCell(pos, true); world->fixPosition(player); } - else if (world->findExteriorPosition(GetCell()->mName, pos)) + else if (world->findExteriorPosition(getCell()->mName, pos)) { world->changeToExteriorCell(pos, true); world->fixPosition(player); @@ -735,8 +735,8 @@ void LocalPlayer::setCell() { try { - world->findInteriorPosition(GetCell()->mName, pos); - world->changeToInteriorCell(GetCell()->mName, pos, true); + world->findInteriorPosition(getCell()->mName, pos); + world->changeToInteriorCell(getCell()->mName, pos, true); } // If we've been sent to an invalid interior, ignore the incoming // packet about our position in that cell diff --git a/apps/openmw/mwmp/Networking.cpp b/apps/openmw/mwmp/Networking.cpp index e505d54ad..fdf685d0d 100644 --- a/apps/openmw/mwmp/Networking.cpp +++ b/apps/openmw/mwmp/Networking.cpp @@ -465,7 +465,7 @@ void Networking::processPlayerPacket(RakNet::Packet *packet) MWBase::Environment::get().getWorld()->findInteriorPosition("Pelagiad, Fort Pelagiad", pos); MWBase::Environment::get().getWorld()->changeToInteriorCell("Pelagiad, Fort Pelagiad", pos, true); (*getLocalPlayer()->Position()) = pos; - (*getLocalPlayer()->GetCell()) = *player.getCell()->getCell(); + (*getLocalPlayer()->getCell()) = *player.getCell()->getCell(); myPacket->Send(getLocalPlayer(), serverAddr); getLocalPlayer()->updateDynamicStats(true); diff --git a/components/openmw-mp/Base/BasePlayer.hpp b/components/openmw-mp/Base/BasePlayer.hpp index 6814e0a10..538cd68cb 100644 --- a/components/openmw-mp/Base/BasePlayer.hpp +++ b/components/openmw-mp/Base/BasePlayer.hpp @@ -117,7 +117,7 @@ namespace mwmp { return &movementFlags; } - virtual ESM::Cell *GetCell() + virtual ESM::Cell *getCell() { return &cell; } diff --git a/components/openmw-mp/Packets/Player/PacketCell.cpp b/components/openmw-mp/Packets/Player/PacketCell.cpp index 67b3ed43f..da8cebab1 100644 --- a/components/openmw-mp/Packets/Player/PacketCell.cpp +++ b/components/openmw-mp/Packets/Player/PacketCell.cpp @@ -17,8 +17,8 @@ void mwmp::PacketCell::Packet(RakNet::BitStream *bs, mwmp::BasePlayer *player, b { PlayerPacket::Packet(bs, player, send); - RW(player->GetCell()->mData.mFlags, send); - RW(player->GetCell()->mData.mX, send); - RW(player->GetCell()->mData.mY, send); - RW(player->GetCell()->mName, send); + RW(player->getCell()->mData.mFlags, send); + RW(player->getCell()->mData.mX, send); + RW(player->getCell()->mData.mY, send); + RW(player->getCell()->mName, send); }