diff --git a/apps/openmw-mp/Cell.cpp b/apps/openmw-mp/Cell.cpp index 306999fec..c02e5f808 100644 --- a/apps/openmw-mp/Cell.cpp +++ b/apps/openmw-mp/Cell.cpp @@ -84,9 +84,9 @@ void Cell::readActorList(unsigned char packetID, const mwmp::BaseActorList *newA mwmp::BaseActor newActor = newActorList->baseActors.at(i); mwmp::BaseActor *cellActor; - if (containsActor(newActor.refNumIndex, newActor.mpNum)) + if (containsActor(newActor.refNum, newActor.mpNum)) { - cellActor = getActor(newActor.refNumIndex, newActor.mpNum); + cellActor = getActor(newActor.refNum, newActor.mpNum); switch (packetID) { @@ -112,25 +112,25 @@ void Cell::readActorList(unsigned char packetID, const mwmp::BaseActorList *newA cellActorList.count = cellActorList.baseActors.size(); } -bool Cell::containsActor(int refNumIndex, int mpNum) +bool Cell::containsActor(int refNum, int mpNum) { for (unsigned int i = 0; i < cellActorList.baseActors.size(); i++) { mwmp::BaseActor actor = cellActorList.baseActors.at(i); - if (actor.refNumIndex == refNumIndex && actor.mpNum == mpNum) + if (actor.refNum == refNum && actor.mpNum == mpNum) return true; } return false; } -mwmp::BaseActor *Cell::getActor(int refNumIndex, int mpNum) +mwmp::BaseActor *Cell::getActor(int refNum, int mpNum) { for (unsigned int i = 0; i < cellActorList.baseActors.size(); i++) { mwmp::BaseActor *actor = &cellActorList.baseActors.at(i); - if (actor->refNumIndex == refNumIndex && actor->mpNum == mpNum) + if (actor->refNum == refNum && actor->mpNum == mpNum) return actor; } return 0; @@ -140,7 +140,7 @@ void Cell::removeActors(const mwmp::BaseActorList *newActorList) { for (std::vector::iterator it = cellActorList.baseActors.begin(); it != cellActorList.baseActors.end();) { - int refNumIndex = (*it).refNumIndex; + int refNum = (*it).refNum; int mpNum = (*it).mpNum; bool foundActor = false; @@ -149,7 +149,7 @@ void Cell::removeActors(const mwmp::BaseActorList *newActorList) { mwmp::BaseActor newActor = newActorList->baseActors.at(i); - if (newActor.refNumIndex == refNumIndex && newActor.mpNum == mpNum) + if (newActor.refNum == refNum && newActor.mpNum == mpNum) { it = cellActorList.baseActors.erase(it); foundActor = true; diff --git a/apps/openmw-mp/Cell.hpp b/apps/openmw-mp/Cell.hpp index 0a21bb89e..04fc6b0e8 100644 --- a/apps/openmw-mp/Cell.hpp +++ b/apps/openmw-mp/Cell.hpp @@ -31,8 +31,8 @@ public: void removePlayer(Player *player); void readActorList(unsigned char packetID, const mwmp::BaseActorList *newActorList); - bool containsActor(int refNumIndex, int mpNum); - mwmp::BaseActor *getActor(int refNumIndex, int mpNum); + bool containsActor(int refNum, int mpNum); + mwmp::BaseActor *getActor(int refNum, int mpNum); void removeActors(const mwmp::BaseActorList *newActorList); RakNet::RakNetGUID *getAuthority(); diff --git a/apps/openmw-mp/Script/Functions/Actors.cpp b/apps/openmw-mp/Script/Functions/Actors.cpp index 5fa125d4f..1dad0db76 100644 --- a/apps/openmw-mp/Script/Functions/Actors.cpp +++ b/apps/openmw-mp/Script/Functions/Actors.cpp @@ -72,9 +72,9 @@ const char *ActorFunctions::GetActorRefId(unsigned int i) noexcept return readActorList->baseActors.at(i).refId.c_str(); } -unsigned int ActorFunctions::GetActorRefNumIndex(unsigned int i) noexcept +unsigned int ActorFunctions::GetActorRefNum(unsigned int i) noexcept { - return readActorList->baseActors.at(i).refNumIndex; + return readActorList->baseActors.at(i).refNum; } unsigned int ActorFunctions::GetActorMpNum(unsigned int i) noexcept @@ -197,9 +197,9 @@ const char *ActorFunctions::GetActorKillerRefId(unsigned int i) noexcept return readActorList->baseActors.at(i).killer.refId.c_str(); } -unsigned int ActorFunctions::GetActorKillerRefNumIndex(unsigned int i) noexcept +unsigned int ActorFunctions::GetActorKillerRefNum(unsigned int i) noexcept { - return readActorList->baseActors.at(i).killer.refNumIndex; + return readActorList->baseActors.at(i).killer.refNum; } unsigned int ActorFunctions::GetActorKillerMpNum(unsigned int i) noexcept @@ -242,9 +242,9 @@ void ActorFunctions::SetActorRefId(const char* refId) noexcept tempActor.refId = refId; } -void ActorFunctions::SetActorRefNumIndex(int refNumIndex) noexcept +void ActorFunctions::SetActorRefNum(int refNum) noexcept { - tempActor.refNumIndex = refNumIndex; + tempActor.refNum = refNum; } void ActorFunctions::SetActorMpNum(int mpNum) noexcept @@ -327,12 +327,12 @@ void ActorFunctions::SetActorAITargetToPlayer(unsigned short pid) noexcept tempActor.aiTarget.guid = player->guid; } -void ActorFunctions::SetActorAITargetToObject(int refNumIndex, int mpNum) noexcept +void ActorFunctions::SetActorAITargetToObject(int refNum, int mpNum) noexcept { tempActor.hasAiTarget = true; tempActor.aiTarget.isPlayer = false; - tempActor.aiTarget.refNumIndex = refNumIndex; + tempActor.aiTarget.refNum = refNum; tempActor.aiTarget.mpNum = mpNum; } @@ -515,3 +515,18 @@ void ActorFunctions::CopyLastActorListToStore() noexcept { CopyLastActorListToStore(); } + +unsigned int ActorFunctions::GetActorRefNumIndex(unsigned int i) noexcept +{ + return GetActorRefNum(i); +} + +unsigned int ActorFunctions::GetActorKillerRefNumIndex(unsigned int i) noexcept +{ + return GetActorKillerRefNum(i); +} + +void ActorFunctions::SetActorRefNumIndex(int refNum) noexcept +{ + tempActor.refNum = refNum; +} diff --git a/apps/openmw-mp/Script/Functions/Actors.hpp b/apps/openmw-mp/Script/Functions/Actors.hpp index a55d6dbf5..3b4609117 100644 --- a/apps/openmw-mp/Script/Functions/Actors.hpp +++ b/apps/openmw-mp/Script/Functions/Actors.hpp @@ -15,7 +15,7 @@ \ {"GetActorCell", ActorFunctions::GetActorCell},\ {"GetActorRefId", ActorFunctions::GetActorRefId},\ - {"GetActorRefNumIndex", ActorFunctions::GetActorRefNumIndex},\ + {"GetActorRefNum", ActorFunctions::GetActorRefNum},\ {"GetActorMpNum", ActorFunctions::GetActorMpNum},\ \ {"GetActorPosX", ActorFunctions::GetActorPosX},\ @@ -43,7 +43,7 @@ {"DoesActorHavePlayerKiller", ActorFunctions::DoesActorHavePlayerKiller},\ {"GetActorKillerPid", ActorFunctions::GetActorKillerPid},\ {"GetActorKillerRefId", ActorFunctions::GetActorKillerRefId},\ - {"GetActorKillerRefNumIndex", ActorFunctions::GetActorKillerRefNumIndex},\ + {"GetActorKillerRefNum", ActorFunctions::GetActorKillerRefNum},\ {"GetActorKillerMpNum", ActorFunctions::GetActorKillerMpNum},\ {"GetActorKillerName", ActorFunctions::GetActorKillerName},\ \ @@ -55,7 +55,7 @@ \ {"SetActorCell", ActorFunctions::SetActorCell},\ {"SetActorRefId", ActorFunctions::SetActorRefId},\ - {"SetActorRefNumIndex", ActorFunctions::SetActorRefNumIndex},\ + {"SetActorRefNum", ActorFunctions::SetActorRefNum},\ {"SetActorMpNum", ActorFunctions::SetActorMpNum},\ \ {"SetActorPosition", ActorFunctions::SetActorPosition},\ @@ -94,7 +94,10 @@ \ {"ReadLastActorList", ActorFunctions::ReadLastActorList},\ {"InitializeActorList", ActorFunctions::InitializeActorList},\ - {"CopyLastActorListToStore", ActorFunctions::CopyLastActorListToStore} + {"CopyLastActorListToStore", ActorFunctions::CopyLastActorListToStore},\ + {"GetActorRefNumIndex", ActorFunctions::GetActorRefNumIndex},\ + {"GetActorKillerRefNumIndex", ActorFunctions::GetActorKillerRefNumIndex},\ + {"SetActorRefNumIndex", ActorFunctions::SetActorRefNumIndex} class ActorFunctions { @@ -173,12 +176,12 @@ public: static const char *GetActorRefId(unsigned int i) noexcept; /** - * \brief Get the refNumIndex of the actor at a certain index in the read actor list. + * \brief Get the refNum of the actor at a certain index in the read actor list. * * \param i The index of the actor. - * \return The refNumIndex. + * \return The refNum. */ - static unsigned int GetActorRefNumIndex(unsigned int i) noexcept; + static unsigned int GetActorRefNum(unsigned int i) noexcept; /** * \brief Get the mpNum of the actor at a certain index in the read actor list. @@ -373,12 +376,12 @@ public: static const char *GetActorKillerRefId(unsigned int i) noexcept; /** - * \brief Get the refNumIndex of the actor killer of the actor at a certain index in the read actor list. + * \brief Get the refNum of the actor killer of the actor at a certain index in the read actor list. * * \param i The index of the actor. - * \return The refNumIndex of the killer. + * \return The refNum of the killer. */ - static unsigned int GetActorKillerRefNumIndex(unsigned int i) noexcept; + static unsigned int GetActorKillerRefNum(unsigned int i) noexcept; /** * \brief Get the mpNum of the actor killer of the actor at a certain index in the read actor list. @@ -460,12 +463,12 @@ public: static void SetActorRefId(const char* refId) noexcept; /** - * \brief Set the refNumIndex of the temporary actor stored on the server. + * \brief Set the refNum of the temporary actor stored on the server. * - * \param refNumIndex The refNumIndex. + * \param refNum The refNum. * \return void */ - static void SetActorRefNumIndex(int refNumIndex) noexcept; + static void SetActorRefNum(int refNum) noexcept; /** * \brief Set the mpNum of the temporary actor stored on the server. @@ -586,11 +589,11 @@ public: /** * \brief Set another object as the AI target of the temporary actor stored on the server. * - * \param refNumIndex The refNumIndex of the target object. + * \param refNum The refNum of the target object. * \param mpNum The mpNum of the target object. * \return void */ - static void SetActorAITargetToObject(int refNumIndex, int mpNum) noexcept; + static void SetActorAITargetToObject(int refNum, int mpNum) noexcept; /** * \brief Set the coordinates for the AI package associated with the current AI action. @@ -746,6 +749,9 @@ public: static void ReadLastActorList() noexcept; static void InitializeActorList(unsigned short pid) noexcept; static void CopyLastActorListToStore() noexcept; + static unsigned int GetActorRefNumIndex(unsigned int i) noexcept; + static unsigned int GetActorKillerRefNumIndex(unsigned int i) noexcept; + static void SetActorRefNumIndex(int refNum) noexcept; }; diff --git a/apps/openmw-mp/Script/Functions/Mechanics.cpp b/apps/openmw-mp/Script/Functions/Mechanics.cpp index 1fe4de09b..8577666b2 100644 --- a/apps/openmw-mp/Script/Functions/Mechanics.cpp +++ b/apps/openmw-mp/Script/Functions/Mechanics.cpp @@ -97,12 +97,12 @@ const char *MechanicsFunctions::GetPlayerKillerRefId(unsigned short pid) noexcep return player->killer.refId.c_str(); } -unsigned int MechanicsFunctions::GetPlayerKillerRefNumIndex(unsigned short pid) noexcept +unsigned int MechanicsFunctions::GetPlayerKillerRefNum(unsigned short pid) noexcept { Player *player; GET_PLAYER(pid, player, 0); - return player->killer.refNumIndex; + return player->killer.refNum; } unsigned int MechanicsFunctions::GetPlayerKillerMpNum(unsigned short pid) noexcept @@ -241,3 +241,8 @@ const char *MechanicsFunctions::GetDeathReason(unsigned short pid) noexcept return "suicide"; } + +unsigned int MechanicsFunctions::GetPlayerKillerRefNumIndex(unsigned short pid) noexcept +{ + return GetPlayerKillerRefNum(pid); +} diff --git a/apps/openmw-mp/Script/Functions/Mechanics.hpp b/apps/openmw-mp/Script/Functions/Mechanics.hpp index 7bca83419..d04f541f5 100644 --- a/apps/openmw-mp/Script/Functions/Mechanics.hpp +++ b/apps/openmw-mp/Script/Functions/Mechanics.hpp @@ -17,7 +17,7 @@ {"DoesPlayerHavePlayerKiller", MechanicsFunctions::DoesPlayerHavePlayerKiller},\ {"GetPlayerKillerPid", MechanicsFunctions::GetPlayerKillerPid},\ {"GetPlayerKillerRefId", MechanicsFunctions::GetPlayerKillerRefId},\ - {"GetPlayerKillerRefNumIndex", MechanicsFunctions::GetPlayerKillerRefNumIndex},\ + {"GetPlayerKillerRefNum", MechanicsFunctions::GetPlayerKillerRefNum},\ {"GetPlayerKillerMpNum", MechanicsFunctions::GetPlayerKillerMpNum},\ {"GetPlayerKillerName", MechanicsFunctions::GetPlayerKillerName},\ \ @@ -32,7 +32,8 @@ {"Jail", MechanicsFunctions::Jail},\ {"Resurrect", MechanicsFunctions::Resurrect},\ \ - {"GetDeathReason", MechanicsFunctions::GetDeathReason} + {"GetDeathReason", MechanicsFunctions::GetDeathReason},\ + {"GetPlayerKillerRefNumIndex", MechanicsFunctions::GetPlayerKillerRefNumIndex} class MechanicsFunctions { @@ -127,12 +128,12 @@ public: static const char *GetPlayerKillerRefId(unsigned short pid) noexcept; /** - * \brief Get the refNumIndex of the actor killer of a certain player. + * \brief Get the refNum of the actor killer of a certain player. * * \param pid The player ID of the killed player. - * \return The refNumIndex of the killer. + * \return The refNum of the killer. */ - static unsigned int GetPlayerKillerRefNumIndex(unsigned short pid) noexcept; + static unsigned int GetPlayerKillerRefNum(unsigned short pid) noexcept; /** * \brief Get the mpNum of the actor killer of a certain player. @@ -258,6 +259,8 @@ public: // All methods below are deprecated versions of methods from above static const char *GetDeathReason(unsigned short pid) noexcept; + static unsigned int GetPlayerKillerRefNumIndex(unsigned short pid) noexcept; + }; #endif //OPENMW_MECHANICSAPI_HPP diff --git a/apps/openmw-mp/Script/Functions/Objects.cpp b/apps/openmw-mp/Script/Functions/Objects.cpp index e6226482c..3a23b90e9 100644 --- a/apps/openmw-mp/Script/Functions/Objects.cpp +++ b/apps/openmw-mp/Script/Functions/Objects.cpp @@ -63,9 +63,9 @@ const char *ObjectFunctions::GetObjectRefId(unsigned int i) noexcept return readObjectList->baseObjects.at(i).refId.c_str(); } -unsigned int ObjectFunctions::GetObjectRefNumIndex(unsigned int i) noexcept +unsigned int ObjectFunctions::GetObjectRefNum(unsigned int i) noexcept { - return readObjectList->baseObjects.at(i).refNumIndex; + return readObjectList->baseObjects.at(i).refNum; } unsigned int ObjectFunctions::GetObjectMpNum(unsigned int i) noexcept @@ -143,9 +143,9 @@ const char *ObjectFunctions::GetObjectSummonerRefId(unsigned int i) noexcept return readObjectList->baseObjects.at(i).master.refId.c_str(); } -unsigned int ObjectFunctions::GetObjectSummonerRefNumIndex(unsigned int i) noexcept +unsigned int ObjectFunctions::GetObjectSummonerRefNum(unsigned int i) noexcept { - return readObjectList->baseObjects.at(i).master.refNumIndex; + return readObjectList->baseObjects.at(i).master.refNum; } unsigned int ObjectFunctions::GetObjectSummonerMpNum(unsigned int i) noexcept @@ -248,9 +248,9 @@ void ObjectFunctions::SetObjectRefId(const char* refId) noexcept tempObject.refId = refId; } -void ObjectFunctions::SetObjectRefNumIndex(int refNumIndex) noexcept +void ObjectFunctions::SetObjectRefNum(int refNum) noexcept { - tempObject.refNumIndex = refNumIndex; + tempObject.refNum = refNum; } void ObjectFunctions::SetObjectMpNum(int mpNum) noexcept @@ -575,6 +575,16 @@ unsigned char ObjectFunctions::GetEventContainerSubAction() noexcept return GetObjectListContainerSubAction(); } +unsigned int ObjectFunctions::GetObjectRefNumIndex(unsigned int i) noexcept +{ + return GetObjectRefNum(i); +} + +unsigned int ObjectFunctions::GetObjectSummonerRefNumIndex(unsigned int i) noexcept +{ + return GetObjectSummonerRefNum(i); +} + void ObjectFunctions::SetEventCell(const char* cellDescription) noexcept { SetObjectListCell(cellDescription); @@ -590,6 +600,11 @@ void ObjectFunctions::SetEventConsoleCommand(const char* consoleCommand) noexcep SetObjectListConsoleCommand(consoleCommand); } +void ObjectFunctions::SetObjectRefNumIndex(int refNum) noexcept +{ + SetObjectRefNum(refNum); +} + void ObjectFunctions::AddWorldObject() noexcept { AddObject(); diff --git a/apps/openmw-mp/Script/Functions/Objects.hpp b/apps/openmw-mp/Script/Functions/Objects.hpp index 5f9524296..4ac3f3938 100644 --- a/apps/openmw-mp/Script/Functions/Objects.hpp +++ b/apps/openmw-mp/Script/Functions/Objects.hpp @@ -14,7 +14,7 @@ {"GetObjectListContainerSubAction", ObjectFunctions::GetObjectListContainerSubAction},\ \ {"GetObjectRefId", ObjectFunctions::GetObjectRefId},\ - {"GetObjectRefNumIndex", ObjectFunctions::GetObjectRefNumIndex},\ + {"GetObjectRefNum", ObjectFunctions::GetObjectRefNum},\ {"GetObjectMpNum", ObjectFunctions::GetObjectMpNum},\ {"GetObjectCount", ObjectFunctions::GetObjectCount},\ {"GetObjectCharge", ObjectFunctions::GetObjectCharge},\ @@ -30,7 +30,7 @@ {"DoesObjectHavePlayerSummoner", ObjectFunctions::DoesObjectHavePlayerSummoner},\ {"GetObjectSummonerPid", ObjectFunctions::GetObjectSummonerPid},\ {"GetObjectSummonerRefId", ObjectFunctions::GetObjectSummonerRefId},\ - {"GetObjectSummonerRefNumIndex", ObjectFunctions::GetObjectSummonerRefNumIndex},\ + {"GetObjectSummonerRefNum", ObjectFunctions::GetObjectSummonerRefNum},\ {"GetObjectSummonerMpNum", ObjectFunctions::GetObjectSummonerMpNum},\ \ {"GetObjectPosX", ObjectFunctions::GetObjectPosX},\ @@ -56,7 +56,7 @@ {"SetObjectListConsoleCommand", ObjectFunctions::SetObjectListConsoleCommand},\ \ {"SetObjectRefId", ObjectFunctions::SetObjectRefId},\ - {"SetObjectRefNumIndex", ObjectFunctions::SetObjectRefNumIndex},\ + {"SetObjectRefNum", ObjectFunctions::SetObjectRefNum},\ {"SetObjectMpNum", ObjectFunctions::SetObjectMpNum},\ {"SetObjectCount", ObjectFunctions::SetObjectCount},\ {"SetObjectCharge", ObjectFunctions::SetObjectCharge},\ @@ -110,9 +110,12 @@ {"GetObjectChangesSize", ObjectFunctions::GetObjectChangesSize},\ {"GetEventAction", ObjectFunctions::GetEventAction},\ {"GetEventContainerSubAction", ObjectFunctions::GetEventContainerSubAction},\ + {"GetObjectRefNumIndex", ObjectFunctions::GetObjectRefNumIndex},\ + {"GetObjectSummonerRefNumIndex", ObjectFunctions::GetObjectSummonerRefNumIndex},\ {"SetEventCell", ObjectFunctions::SetEventCell},\ {"SetEventAction", ObjectFunctions::SetEventAction},\ {"SetEventConsoleCommand", ObjectFunctions::SetEventConsoleCommand},\ + {"SetObjectRefNumIndex", ObjectFunctions::SetObjectRefNumIndex},\ {"AddWorldObject", ObjectFunctions::AddWorldObject} class ObjectFunctions @@ -179,13 +182,13 @@ public: static const char *GetObjectRefId(unsigned int i) noexcept; /** - * \brief Get the refNumIndex of the object at a certain index in the read object list's object + * \brief Get the refNum of the object at a certain index in the read object list's object * changes. * * \param i The index of the object. - * \return The refNumIndex. + * \return The refNum. */ - static unsigned int GetObjectRefNumIndex(unsigned int i) noexcept; + static unsigned int GetObjectRefNum(unsigned int i) noexcept; /** * \brief Get the mpNum of the object at a certain index in the read object list's object changes. @@ -317,13 +320,13 @@ public: static const char *GetObjectSummonerRefId(unsigned int i) noexcept; /** - * \brief Get the refNumIndex of the actor summoner of the object at a certain index in the read object + * \brief Get the refNum of the actor summoner of the object at a certain index in the read object * list's object changes. * * \param i The index of the object. - * \return The refNumIndex of the summoner. + * \return The refNum of the summoner. */ - static unsigned int GetObjectSummonerRefNumIndex(unsigned int i) noexcept; + static unsigned int GetObjectSummonerRefNum(unsigned int i) noexcept; /** * \brief Get the mpNum of the actor summoner of the object at a certain index in the read object list's @@ -505,18 +508,18 @@ public: static void SetObjectRefId(const char* refId) noexcept; /** - * \brief Set the refNumIndex of the temporary object stored on the server. + * \brief Set the refNum of the temporary object stored on the server. * - * Every object loaded from .ESM and .ESP data files has a unique refNumIndex which needs to be + * Every object loaded from .ESM and .ESP data files has a unique refNum which needs to be * retained to refer to it in packets. * - * On the other hand, objects placed or spawned via the server should always have a refNumIndex + * On the other hand, objects placed or spawned via the server should always have a refNum * of 0. * - * \param refNumIndex The refNumIndex. + * \param refNum The refNum. * \return void */ - static void SetObjectRefNumIndex(int refNumIndex) noexcept; + static void SetObjectRefNum(int refNum) noexcept; /** * \brief Set the mpNum of the temporary object stored on the server. @@ -526,7 +529,7 @@ public: * for these objects. * * Objects loaded from .ESM and .ESP data files should always have an mpNum of 0, because they - * have unique refNumIndexes instead. + * have unique refNumes instead. * * \param mpNum The mpNum. * \return void @@ -920,9 +923,12 @@ public: static unsigned int GetObjectChangesSize() noexcept; static unsigned char GetEventAction() noexcept; static unsigned char GetEventContainerSubAction() noexcept; + static unsigned int GetObjectRefNumIndex(unsigned int i) noexcept; + static unsigned int GetObjectSummonerRefNumIndex(unsigned int i) noexcept; static void SetEventCell(const char* cellDescription) noexcept; static void SetEventAction(unsigned char action) noexcept; static void SetEventConsoleCommand(const char* consoleCommand) noexcept; + static void SetObjectRefNumIndex(int refNum) noexcept; static void AddWorldObject() noexcept; }; diff --git a/apps/openmw/mwbase/world.hpp b/apps/openmw/mwbase/world.hpp index 5e3f6739d..52e870420 100644 --- a/apps/openmw/mwbase/world.hpp +++ b/apps/openmw/mwbase/world.hpp @@ -187,9 +187,9 @@ namespace MWBase /* Start of tes3mp addition - Make it possible to find a Ptr in any active cell based on its refNumIndex and mpNum + Make it possible to find a Ptr in any active cell based on its refNum and mpNum */ - virtual MWWorld::Ptr searchPtrViaRefIndex(int refNumIndex, int mpNum) = 0; + virtual MWWorld::Ptr searchPtrViaRefIndex(int refNum, int mpNum) = 0; /* End of tes3mp addition */ diff --git a/apps/openmw/mwgui/console.cpp b/apps/openmw/mwgui/console.cpp index f34a5d3e0..04ce3f768 100644 --- a/apps/openmw/mwgui/console.cpp +++ b/apps/openmw/mwgui/console.cpp @@ -429,7 +429,7 @@ namespace MWGui /* Start of tes3mp change (major) - Display the selected object's refNumIndex and mpNum alongside its refId in the + Display the selected object's refNum and mpNum alongside its refId in the title of the console window, for easier debugging of almost everything */ setTitle("#{sConsoleTitle} (" + object.getCellRef().getRefId() + ", " + diff --git a/apps/openmw/mwgui/container.cpp b/apps/openmw/mwgui/container.cpp index c189fed2c..daa503635 100644 --- a/apps/openmw/mwgui/container.cpp +++ b/apps/openmw/mwgui/container.cpp @@ -127,7 +127,7 @@ namespace MWGui mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->Send(); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_CONTAINER about\n- Ptr cellRef: %s, %i\n- cell: %s\n- item: %s, %i", - baseObject.refId.c_str(), baseObject.refNumIndex, objectList->cell.getDescription().c_str(), + baseObject.refId.c_str(), baseObject.refNum, objectList->cell.getDescription().c_str(), itemPtr.getCellRef().getRefId().c_str(), itemPtr.getRefData().getCount()); /* End of tes3mp addition @@ -182,7 +182,7 @@ namespace MWGui mwmp::Main::get().getNetworking()->getObjectPacket(ID_CONTAINER)->Send(); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_CONTAINER about\n- Ptr cellRef: %s %i-%i\n- cell: %s\n- item: %s %i, %i", - baseObject.refId.c_str(), baseObject.refNumIndex, baseObject.mpNum, objectList->cell.getDescription().c_str(), + baseObject.refId.c_str(), baseObject.refNum, baseObject.mpNum, objectList->cell.getDescription().c_str(), containerItem.refId.c_str(), containerItem.count, containerItem.charge); } /* diff --git a/apps/openmw/mwmp/ActorList.cpp b/apps/openmw/mwmp/ActorList.cpp index b20d49f15..6e0fa5125 100644 --- a/apps/openmw/mwmp/ActorList.cpp +++ b/apps/openmw/mwmp/ActorList.cpp @@ -209,7 +209,7 @@ void ActorList::sendActorsInCell(MWWorld::CellStore* cellStore) BaseActor actor; actor.refId = ptr.getCellRef().getRefId(); - actor.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + actor.refNum = ptr.getCellRef().getRefNum().mIndex; actor.mpNum = ptr.getCellRef().getMpNum(); addActor(actor); @@ -224,7 +224,7 @@ void ActorList::sendActorsInCell(MWWorld::CellStore* cellStore) BaseActor actor; actor.refId = ptr.getCellRef().getRefId(); - actor.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + actor.refNum = ptr.getCellRef().getRefNum().mIndex; actor.mpNum = ptr.getCellRef().getMpNum(); addActor(actor); diff --git a/apps/openmw/mwmp/Cell.cpp b/apps/openmw/mwmp/Cell.cpp index c4c16afe9..026ea62ab 100644 --- a/apps/openmw/mwmp/Cell.cpp +++ b/apps/openmw/mwmp/Cell.cpp @@ -432,7 +432,7 @@ void Cell::initializeDedicatedActors(ActorList& actorList) // If this key doesn't exist, create it if (dedicatedActors.count(mapIndex) == 0) { - MWWorld::Ptr ptrFound = store->searchExact(baseActor.refNumIndex, baseActor.mpNum); + MWWorld::Ptr ptrFound = store->searchExact(baseActor.refNum, baseActor.mpNum); if (!ptrFound) return; diff --git a/apps/openmw/mwmp/CellController.cpp b/apps/openmw/mwmp/CellController.cpp index f861752a9..b94d02cbe 100644 --- a/apps/openmw/mwmp/CellController.cpp +++ b/apps/openmw/mwmp/CellController.cpp @@ -207,9 +207,9 @@ bool CellController::isLocalActor(MWWorld::Ptr ptr) return localActorsToCells.count(actorIndex) > 0; } -bool CellController::isLocalActor(int refNumIndex, int mpNum) +bool CellController::isLocalActor(int refNum, int mpNum) { - std::string actorIndex = generateMapIndex(refNumIndex, mpNum); + std::string actorIndex = generateMapIndex(refNum, mpNum); return localActorsToCells.count(actorIndex) > 0; } @@ -222,9 +222,9 @@ LocalActor *CellController::getLocalActor(MWWorld::Ptr ptr) return cellsInitialized.at(cellIndex)->getLocalActor(actorIndex); } -LocalActor *CellController::getLocalActor(int refNumIndex, int mpNum) +LocalActor *CellController::getLocalActor(int refNum, int mpNum) { - std::string actorIndex = generateMapIndex(refNumIndex, mpNum); + std::string actorIndex = generateMapIndex(refNum, mpNum); std::string cellIndex = localActorsToCells.at(actorIndex); return cellsInitialized.at(cellIndex)->getLocalActor(actorIndex); @@ -250,9 +250,9 @@ bool CellController::isDedicatedActor(MWWorld::Ptr ptr) return dedicatedActorsToCells.count(actorIndex) > 0; } -bool CellController::isDedicatedActor(int refNumIndex, int mpNum) +bool CellController::isDedicatedActor(int refNum, int mpNum) { - std::string actorIndex = generateMapIndex(refNumIndex, mpNum); + std::string actorIndex = generateMapIndex(refNum, mpNum); return dedicatedActorsToCells.count(actorIndex) > 0; } @@ -265,18 +265,18 @@ DedicatedActor *CellController::getDedicatedActor(MWWorld::Ptr ptr) return cellsInitialized.at(cellIndex)->getDedicatedActor(actorIndex); } -DedicatedActor *CellController::getDedicatedActor(int refNumIndex, int mpNum) +DedicatedActor *CellController::getDedicatedActor(int refNum, int mpNum) { - std::string actorIndex = generateMapIndex(refNumIndex, mpNum); + std::string actorIndex = generateMapIndex(refNum, mpNum); std::string cellIndex = dedicatedActorsToCells.at(actorIndex); return cellsInitialized.at(cellIndex)->getDedicatedActor(actorIndex); } -std::string CellController::generateMapIndex(int refNumIndex, int mpNum) +std::string CellController::generateMapIndex(int refNum, int mpNum) { std::string mapIndex = ""; - mapIndex = Utils::toString(refNumIndex) + "-" + Utils::toString(mpNum); + mapIndex = Utils::toString(refNum) + "-" + Utils::toString(mpNum); return mapIndex; } @@ -287,7 +287,7 @@ std::string CellController::generateMapIndex(MWWorld::Ptr ptr) std::string CellController::generateMapIndex(BaseActor baseActor) { - return generateMapIndex(baseActor.refNumIndex, baseActor.mpNum); + return generateMapIndex(baseActor.refNum, baseActor.mpNum); } bool CellController::hasLocalAuthority(const ESM::Cell& cell) diff --git a/apps/openmw/mwmp/CellController.hpp b/apps/openmw/mwmp/CellController.hpp index b6af44a0e..c8e2b4aa9 100644 --- a/apps/openmw/mwmp/CellController.hpp +++ b/apps/openmw/mwmp/CellController.hpp @@ -35,17 +35,17 @@ namespace mwmp void removeLocalActorRecord(std::string actorIndex); bool isLocalActor(MWWorld::Ptr ptr); - bool isLocalActor(int refNumIndex, int mpNum); + bool isLocalActor(int refNum, int mpNum); virtual LocalActor *getLocalActor(MWWorld::Ptr ptr); - virtual LocalActor *getLocalActor(int refNumIndex, int mpNum); + virtual LocalActor *getLocalActor(int refNum, int mpNum); void setDedicatedActorRecord(std::string actorIndex, std::string cellIndex); void removeDedicatedActorRecord(std::string actorIndex); bool isDedicatedActor(MWWorld::Ptr ptr); - bool isDedicatedActor(int refNumIndex, int mpNum); + bool isDedicatedActor(int refNum, int mpNum); virtual DedicatedActor *getDedicatedActor(MWWorld::Ptr ptr); - virtual DedicatedActor *getDedicatedActor(int refNumIndex, int mpNum); + virtual DedicatedActor *getDedicatedActor(int refNum, int mpNum); std::string generateMapIndex(int refNumindex, int mpNum); std::string generateMapIndex(MWWorld::Ptr ptr); diff --git a/apps/openmw/mwmp/DedicatedActor.cpp b/apps/openmw/mwmp/DedicatedActor.cpp index 641e446e9..33ac0a43c 100644 --- a/apps/openmw/mwmp/DedicatedActor.cpp +++ b/apps/openmw/mwmp/DedicatedActor.cpp @@ -256,22 +256,22 @@ void DedicatedActor::setAi() } else { - if (mwmp::Main::get().getCellController()->isLocalActor(aiTarget.refNumIndex, aiTarget.mpNum)) - targetPtr = mwmp::Main::get().getCellController()->getLocalActor(aiTarget.refNumIndex, aiTarget.mpNum)->getPtr(); - else if (mwmp::Main::get().getCellController()->isDedicatedActor(aiTarget.refNumIndex, aiTarget.mpNum)) - targetPtr = mwmp::Main::get().getCellController()->getDedicatedActor(aiTarget.refNumIndex, aiTarget.mpNum)->getPtr(); + if (mwmp::Main::get().getCellController()->isLocalActor(aiTarget.refNum, aiTarget.mpNum)) + targetPtr = mwmp::Main::get().getCellController()->getLocalActor(aiTarget.refNum, aiTarget.mpNum)->getPtr(); + else if (mwmp::Main::get().getCellController()->isDedicatedActor(aiTarget.refNum, aiTarget.mpNum)) + targetPtr = mwmp::Main::get().getCellController()->getDedicatedActor(aiTarget.refNum, aiTarget.mpNum)->getPtr(); else if (aiAction == mwmp::BaseActorList::ACTIVATE) - targetPtr = MWBase::Environment::get().getWorld()->searchPtrViaRefIndex(aiTarget.refNumIndex, aiTarget.mpNum); + targetPtr = MWBase::Environment::get().getWorld()->searchPtrViaRefIndex(aiTarget.refNum, aiTarget.mpNum); if (targetPtr) { LOG_APPEND(Log::LOG_VERBOSE, "-- Has AI target %s %i-%i", - targetPtr.getCellRef().getRefId().c_str(), aiTarget.refNumIndex, aiTarget.mpNum); + targetPtr.getCellRef().getRefId().c_str(), aiTarget.refNum, aiTarget.mpNum); } else { LOG_APPEND(Log::LOG_VERBOSE, "-- Has invalid target AI target %i-%i", - aiTarget.refNumIndex, aiTarget.mpNum); + aiTarget.refNum, aiTarget.mpNum); } } @@ -373,7 +373,7 @@ void DedicatedActor::setPtr(const MWWorld::Ptr& newPtr) ptr = newPtr; refId = ptr.getCellRef().getRefId(); - refNumIndex = ptr.getCellRef().getRefNum().mIndex; + refNum = ptr.getCellRef().getRefNum().mIndex; mpNum = ptr.getCellRef().getMpNum(); position = ptr.getRefData().getPosition(); diff --git a/apps/openmw/mwmp/LocalActor.cpp b/apps/openmw/mwmp/LocalActor.cpp index 31b856f69..ca0e22656 100644 --- a/apps/openmw/mwmp/LocalActor.cpp +++ b/apps/openmw/mwmp/LocalActor.cpp @@ -66,7 +66,7 @@ void LocalActor::update(bool forceUpdate) void LocalActor::updateCell() { LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_ACTOR_CELL_CHANGE about %s %i-%i to server", - refId.c_str(), refNumIndex, mpNum); + refId.c_str(), refNum, mpNum); LOG_APPEND(Log::LOG_INFO, "- Moved from %s to %s", cell.getDescription().c_str(), ptr.getCell()->getCell()->getDescription().c_str()); @@ -191,7 +191,7 @@ void LocalActor::updateStatsDynamic(bool forceUpdate) killer = MechanicsHelper::getTarget(ptr); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_ACTOR_DEATH about %s %i-%i to server", - refId.c_str(), refNumIndex, mpNum); + refId.c_str(), refNum, mpNum); mwmp::Main::get().getNetworking()->getActorList()->addDeathActor(*this); @@ -274,7 +274,7 @@ void LocalActor::setPtr(const MWWorld::Ptr& newPtr) ptr = newPtr; refId = ptr.getCellRef().getRefId(); - refNumIndex = ptr.getCellRef().getRefNum().mIndex; + refNum = ptr.getCellRef().getRefNum().mIndex; mpNum = ptr.getCellRef().getMpNum(); lastDrawState = ptr.getClass().getCreatureStats(ptr).getDrawState(); diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index 284300252..01a4c18f7 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -1633,7 +1633,7 @@ void LocalPlayer::clearCellStates() void LocalPlayer::clearCurrentContainer() { currentContainer.refId = ""; - currentContainer.refNumIndex = 0; + currentContainer.refNum = 0; currentContainer.mpNum = 0; } @@ -1661,7 +1661,7 @@ void LocalPlayer::storeCellState(const ESM::Cell& cell, int stateType) void LocalPlayer::storeCurrentContainer(const MWWorld::Ptr &container) { currentContainer.refId = container.getCellRef().getRefId(); - currentContainer.refNumIndex = container.getCellRef().getRefNum().mIndex; + currentContainer.refNum = container.getCellRef().getRefNum().mIndex; currentContainer.mpNum = container.getCellRef().getMpNum(); } diff --git a/apps/openmw/mwmp/MechanicsHelper.cpp b/apps/openmw/mwmp/MechanicsHelper.cpp index d8009391e..f1811f273 100644 --- a/apps/openmw/mwmp/MechanicsHelper.cpp +++ b/apps/openmw/mwmp/MechanicsHelper.cpp @@ -119,7 +119,7 @@ mwmp::Target MechanicsHelper::getTarget(const MWWorld::Ptr& ptr) { target.isPlayer = false; target.refId = ptrRef->getRefId(); - target.refNumIndex = ptrRef->getRefNum().mIndex; + target.refNum = ptrRef->getRefNum().mIndex; target.mpNum = ptrRef->getMpNum(); target.name = ptr.getClass().getName(ptr); } @@ -133,7 +133,7 @@ void MechanicsHelper::clearTarget(mwmp::Target& target) { target.isPlayer = false; target.refId.clear(); - target.refNumIndex = -1; + target.refNum = -1; target.mpNum = -1; target.name.clear(); @@ -165,7 +165,7 @@ void MechanicsHelper::assignAttackTarget(Attack* attack, const MWWorld::Ptr& tar attack->target.isPlayer = false; attack->target.refId = targetRef->getRefId(); - attack->target.refNumIndex = targetRef->getRefNum().mIndex; + attack->target.refNum = targetRef->getRefNum().mIndex; attack->target.mpNum = targetRef->getMpNum(); } } @@ -179,7 +179,7 @@ void MechanicsHelper::resetAttack(Attack* attack) attack->applyProjectileEnchantment = false; attack->target.guid = RakNet::RakNetGUID(); attack->target.refId.clear(); - attack->target.refNumIndex = 0; + attack->target.refNum = 0; attack->target.mpNum = 0; } @@ -215,10 +215,10 @@ void MechanicsHelper::processAttack(Attack attack, const MWWorld::Ptr& attacker) else { auto controller = mwmp::Main::get().getCellController(); - if (controller->isLocalActor(attack.target.refNumIndex, attack.target.mpNum)) - victim = controller->getLocalActor(attack.target.refNumIndex, attack.target.mpNum)->getPtr(); - else if (controller->isDedicatedActor(attack.target.refNumIndex, attack.target.mpNum)) - victim = controller->getDedicatedActor(attack.target.refNumIndex, attack.target.mpNum)->getPtr(); + if (controller->isLocalActor(attack.target.refNum, attack.target.mpNum)) + victim = controller->getLocalActor(attack.target.refNum, attack.target.mpNum)->getPtr(); + else if (controller->isDedicatedActor(attack.target.refNum, attack.target.mpNum)) + victim = controller->getDedicatedActor(attack.target.refNum, attack.target.mpNum)->getPtr(); } // Get the weapon used (if hand-to-hand, weapon = inv.end()) diff --git a/apps/openmw/mwmp/ObjectList.cpp b/apps/openmw/mwmp/ObjectList.cpp index c0c0ce845..97ea60a20 100644 --- a/apps/openmw/mwmp/ObjectList.cpp +++ b/apps/openmw/mwmp/ObjectList.cpp @@ -66,7 +66,7 @@ BaseObject ObjectList::getBaseObject(const MWWorld::Ptr& ptr) { mwmp::BaseObject baseObject; baseObject.refId = ptr.getCellRef().getRefId(); - baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.refNum = ptr.getCellRef().getRefNum().mIndex; baseObject.mpNum = ptr.getCellRef().getMpNum(); return baseObject; } @@ -114,9 +114,9 @@ void ObjectList::editContainers(MWWorld::CellStore* cellStore) { baseObject = baseObjects.at(i); - LOG_APPEND(Log::LOG_VERBOSE, "- container cellRef: %s %i-%i", baseObject.refId.c_str(), baseObject.refNumIndex, baseObject.mpNum); + LOG_APPEND(Log::LOG_VERBOSE, "- container cellRef: %s %i-%i", baseObject.refId.c_str(), baseObject.refNum, baseObject.mpNum); - MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNum, baseObject.mpNum); if (ptrFound) { @@ -131,7 +131,7 @@ void ObjectList::editContainers(MWWorld::CellStore* cellStore) { CurrentContainer *currentContainer = &mwmp::Main::get().getLocalPlayer()->currentContainer; - if (currentContainer->refNumIndex == ptrFound.getCellRef().getRefNum().mIndex && + if (currentContainer->refNum == ptrFound.getCellRef().getRefNum().mIndex && currentContainer->mpNum == ptrFound.getCellRef().getMpNum()) { isCurrentContainer = true; @@ -269,7 +269,7 @@ void ObjectList::placeObjects(MWWorld::CellStore* cellStore) for (const auto &baseObject : baseObjects) { LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s %i-%i, count: %i, charge: %i, enchantmentCharge: %i", baseObject.refId.c_str(), - baseObject.refNumIndex, baseObject.mpNum, baseObject.count, baseObject.charge, baseObject.enchantmentCharge); + baseObject.refNum, baseObject.mpNum, baseObject.count, baseObject.charge, baseObject.enchantmentCharge); // Ignore generic dynamic refIds because they could be anything on other clients if (baseObject.refId.find("$dynamic") != string::npos) @@ -320,7 +320,7 @@ void ObjectList::spawnObjects(MWWorld::CellStore* cellStore) for (const auto &baseObject : baseObjects) { LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s %i-%i", baseObject.refId.c_str(), - baseObject.refNumIndex, baseObject.mpNum); + baseObject.refNum, baseObject.mpNum); // Ignore generic dynamic refIds because they could be anything on other clients if (baseObject.refId.find("$dynamic") != string::npos) @@ -345,7 +345,7 @@ void ObjectList::spawnObjects(MWWorld::CellStore* cellStore) if (baseObject.master.isPlayer) masterPtr = MechanicsHelper::getPlayerPtr(baseObject.master); else - masterPtr = cellStore->searchExact(baseObject.master.refNumIndex, baseObject.master.mpNum); + masterPtr = cellStore->searchExact(baseObject.master.refNum, baseObject.master.mpNum); if (masterPtr) { @@ -379,9 +379,9 @@ void ObjectList::deleteObjects(MWWorld::CellStore* cellStore) { for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s %i-%i", baseObject.refId.c_str(), baseObject.refNumIndex, baseObject.mpNum); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s %i-%i", baseObject.refId.c_str(), baseObject.refNum, baseObject.mpNum); - MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNum, baseObject.mpNum); if (ptrFound) { @@ -393,7 +393,7 @@ void ObjectList::deleteObjects(MWWorld::CellStore* cellStore) { CurrentContainer *currentContainer = &mwmp::Main::get().getLocalPlayer()->currentContainer; - if (currentContainer->refNumIndex == ptrFound.getCellRef().getRefNum().mIndex && + if (currentContainer->refNum == ptrFound.getCellRef().getRefNum().mIndex && currentContainer->mpNum == ptrFound.getCellRef().getMpNum()) { MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Container); @@ -410,9 +410,9 @@ void ObjectList::lockObjects(MWWorld::CellStore* cellStore) { for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s %i-%i", baseObject.refId.c_str(), baseObject.refNumIndex, baseObject.mpNum); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s %i-%i", baseObject.refId.c_str(), baseObject.refNum, baseObject.mpNum); - MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNum, baseObject.mpNum); if (ptrFound) { @@ -431,9 +431,9 @@ void ObjectList::triggerTrapObjects(MWWorld::CellStore* cellStore) { for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s %i-%i", baseObject.refId.c_str(), baseObject.refNumIndex, baseObject.mpNum); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s %i-%i", baseObject.refId.c_str(), baseObject.refNum, baseObject.mpNum); - MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNum, baseObject.mpNum); if (ptrFound) { @@ -456,10 +456,10 @@ void ObjectList::scaleObjects(MWWorld::CellStore* cellStore) { for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s %i-%i, scale: %f", baseObject.refId.c_str(), baseObject.refNumIndex, + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s %i-%i, scale: %f", baseObject.refId.c_str(), baseObject.refNum, baseObject.mpNum, baseObject.scale); - MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNum, baseObject.mpNum); if (ptrFound) { @@ -475,10 +475,10 @@ void ObjectList::setObjectStates(MWWorld::CellStore* cellStore) { for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s %i-%i, state: %s", baseObject.refId.c_str(), baseObject.refNumIndex, + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s %i-%i, state: %s", baseObject.refId.c_str(), baseObject.refNum, baseObject.mpNum, baseObject.objectState ? "true" : "false"); - MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNum, baseObject.mpNum); if (ptrFound) { @@ -497,9 +497,9 @@ void ObjectList::moveObjects(MWWorld::CellStore* cellStore) { for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s %i-%i", baseObject.refId.c_str(), baseObject.refNumIndex, baseObject.mpNum); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s %i-%i", baseObject.refId.c_str(), baseObject.refNum, baseObject.mpNum); - MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNum, baseObject.mpNum); if (ptrFound) { @@ -516,9 +516,9 @@ void ObjectList::rotateObjects(MWWorld::CellStore* cellStore) { for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s %i-%i", baseObject.refId.c_str(), baseObject.refNumIndex, baseObject.mpNum); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s %i-%i", baseObject.refId.c_str(), baseObject.refNum, baseObject.mpNum); - MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNum, baseObject.mpNum); if (ptrFound) { @@ -535,9 +535,9 @@ void ObjectList::animateObjects(MWWorld::CellStore* cellStore) { for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s %i-%i", baseObject.refId.c_str(), baseObject.refNumIndex, baseObject.mpNum); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s %i-%i", baseObject.refId.c_str(), baseObject.refNum, baseObject.mpNum); - MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNum, baseObject.mpNum); if (ptrFound) { @@ -555,9 +555,9 @@ void ObjectList::activateDoors(MWWorld::CellStore* cellStore) { for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s %i-%i", baseObject.refId.c_str(), baseObject.refNumIndex, baseObject.mpNum); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s %i-%i", baseObject.refId.c_str(), baseObject.refNum, baseObject.mpNum); - MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNum, baseObject.mpNum); if (ptrFound) { @@ -574,9 +574,9 @@ void ObjectList::setDoorDestinations(MWWorld::CellStore* cellStore) { for (const auto &baseObject : baseObjects) { - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s %i-%i", baseObject.refId.c_str(), baseObject.refNumIndex, baseObject.mpNum); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s %i-%i", baseObject.refId.c_str(), baseObject.refNum, baseObject.mpNum); - MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNum, baseObject.mpNum); if (ptrFound) { @@ -639,9 +639,9 @@ void ObjectList::runConsoleCommands(MWWorld::CellStore* cellStore) } else { - LOG_APPEND(Log::LOG_VERBOSE, "-- running on cellRef: %s %i-%i", baseObject.refId.c_str(), baseObject.refNumIndex, baseObject.mpNum); + LOG_APPEND(Log::LOG_VERBOSE, "-- running on cellRef: %s %i-%i", baseObject.refId.c_str(), baseObject.refNum, baseObject.mpNum); - MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNum, baseObject.mpNum); if (ptrFound) { @@ -663,9 +663,9 @@ void ObjectList::setLocalShorts(MWWorld::CellStore* cellStore) for (const auto &baseObject : baseObjects) { LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s %i-%i, index: %i, shortVal: %i", baseObject.refId.c_str(), - baseObject.refNumIndex, baseObject.mpNum, baseObject.index, baseObject.shortVal); + baseObject.refNum, baseObject.mpNum, baseObject.index, baseObject.shortVal); - MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNum, baseObject.mpNum); if (ptrFound) { @@ -682,9 +682,9 @@ void ObjectList::setLocalFloats(MWWorld::CellStore* cellStore) for (const auto &baseObject : baseObjects) { LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s %i-%i, index: %i, floatVal: %f", baseObject.refId.c_str(), - baseObject.refNumIndex, baseObject.mpNum, baseObject.index, baseObject.floatVal); + baseObject.refNum, baseObject.mpNum, baseObject.index, baseObject.floatVal); - MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNum, baseObject.mpNum); if (ptrFound) { @@ -778,9 +778,9 @@ void ObjectList::addRequestedContainers(MWWorld::CellStore* cellStore, const std for (const auto &baseObject : requestObjects) { LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s %i-%i", baseObject.refId.c_str(), - baseObject.refNumIndex, baseObject.mpNum); + baseObject.refNum, baseObject.mpNum); - MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNumIndex, baseObject.mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(baseObject.refNum, baseObject.mpNum); if (ptrFound) { @@ -804,7 +804,7 @@ void ObjectList::addObjectPlace(const MWWorld::Ptr& ptr, bool droppedByPlayer) mwmp::BaseObject baseObject; baseObject.refId = ptr.getCellRef().getRefId(); - baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.refNum = ptr.getCellRef().getRefNum().mIndex; baseObject.mpNum = 0; baseObject.charge = ptr.getCellRef().getCharge(); baseObject.enchantmentCharge = ptr.getCellRef().getEnchantmentCharge(); @@ -837,7 +837,7 @@ void ObjectList::addObjectSpawn(const MWWorld::Ptr& ptr) mwmp::BaseObject baseObject; baseObject.refId = ptr.getCellRef().getRefId(); - baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.refNum = ptr.getCellRef().getRefNum().mIndex; baseObject.mpNum = 0; baseObject.isSummon = false; baseObject.summonDuration = -1; @@ -855,7 +855,7 @@ void ObjectList::addObjectSpawn(const MWWorld::Ptr& ptr, const MWWorld::Ptr& mas mwmp::BaseObject baseObject; baseObject.refId = ptr.getCellRef().getRefId(); - baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.refNum = ptr.getCellRef().getRefNum().mIndex; baseObject.mpNum = 0; baseObject.isSummon = true; baseObject.summonDuration = duration; @@ -874,7 +874,7 @@ void ObjectList::addObjectDelete(const MWWorld::Ptr& ptr) mwmp::BaseObject baseObject; baseObject.refId = ptr.getCellRef().getRefId(); - baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.refNum = ptr.getCellRef().getRefNum().mIndex; baseObject.mpNum = ptr.getCellRef().getMpNum(); addObject(baseObject); } @@ -885,7 +885,7 @@ void ObjectList::addObjectLock(const MWWorld::Ptr& ptr, int lockLevel) mwmp::BaseObject baseObject; baseObject.refId = ptr.getCellRef().getRefId(); - baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.refNum = ptr.getCellRef().getRefNum().mIndex; baseObject.mpNum = ptr.getCellRef().getMpNum(); baseObject.lockLevel = lockLevel; addObject(baseObject); @@ -897,7 +897,7 @@ void ObjectList::addObjectTrap(const MWWorld::Ptr& ptr, const ESM::Position& pos mwmp::BaseObject baseObject; baseObject.refId = ptr.getCellRef().getRefId(); - baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.refNum = ptr.getCellRef().getRefNum().mIndex; baseObject.mpNum = ptr.getCellRef().getMpNum(); baseObject.isDisarmed = isDisarmed; baseObject.position = pos; @@ -910,7 +910,7 @@ void ObjectList::addObjectScale(const MWWorld::Ptr& ptr, float scale) mwmp::BaseObject baseObject; baseObject.refId = ptr.getCellRef().getRefId(); - baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.refNum = ptr.getCellRef().getRefNum().mIndex; baseObject.mpNum = ptr.getCellRef().getMpNum(); baseObject.scale = scale; addObject(baseObject); @@ -922,7 +922,7 @@ void ObjectList::addObjectState(const MWWorld::Ptr& ptr, bool objectState) mwmp::BaseObject baseObject; baseObject.refId = ptr.getCellRef().getRefId(); - baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.refNum = ptr.getCellRef().getRefNum().mIndex; baseObject.mpNum = ptr.getCellRef().getMpNum(); baseObject.objectState = objectState; addObject(baseObject); @@ -934,7 +934,7 @@ void ObjectList::addObjectAnimPlay(const MWWorld::Ptr& ptr, std::string group, i mwmp::BaseObject baseObject; baseObject.refId = ptr.getCellRef().getRefId(); - baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.refNum = ptr.getCellRef().getRefNum().mIndex; baseObject.mpNum = ptr.getCellRef().getMpNum(); baseObject.animGroup = group; baseObject.animMode = mode; @@ -947,7 +947,7 @@ void ObjectList::addDoorState(const MWWorld::Ptr& ptr, int state) mwmp::BaseObject baseObject; baseObject.refId = ptr.getCellRef().getRefId(); - baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.refNum = ptr.getCellRef().getRefNum().mIndex; baseObject.mpNum = ptr.getCellRef().getMpNum(); baseObject.doorState = state; addObject(baseObject); @@ -974,7 +974,7 @@ void ObjectList::addScriptLocalShort(const MWWorld::Ptr& ptr, int index, int sho mwmp::BaseObject baseObject; baseObject.refId = ptr.getCellRef().getRefId(); - baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.refNum = ptr.getCellRef().getRefNum().mIndex; baseObject.mpNum = ptr.getCellRef().getMpNum(); baseObject.index = index; baseObject.shortVal = shortVal; @@ -987,7 +987,7 @@ void ObjectList::addScriptLocalFloat(const MWWorld::Ptr& ptr, int index, float f mwmp::BaseObject baseObject; baseObject.refId = ptr.getCellRef().getRefId(); - baseObject.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseObject.refNum = ptr.getCellRef().getRefNum().mIndex; baseObject.mpNum = ptr.getCellRef().getMpNum(); baseObject.index = index; baseObject.floatVal = floatVal; @@ -1033,7 +1033,7 @@ void ObjectList::sendObjectSpawn() LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_OBJECT_SPAWN about %s", cell.getDescription().c_str()); for (const auto &baseObject : baseObjects) - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s-%i", baseObject.refId.c_str(), baseObject.refNumIndex); + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s-%i", baseObject.refId.c_str(), baseObject.refNum); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_SPAWN)->setObjectList(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_OBJECT_SPAWN)->Send(); @@ -1080,7 +1080,7 @@ void ObjectList::sendDoorState() LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_DOOR_STATE about %s", cell.getDescription().c_str()); for (const auto &baseObject : baseObjects) - LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s-%i, state: %s", baseObject.refId.c_str(), baseObject.refNumIndex, + LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s-%i, state: %s", baseObject.refId.c_str(), baseObject.refNum, baseObject.doorState ? "true" : "false"); mwmp::Main::get().getNetworking()->getObjectPacket(ID_DOOR_STATE)->setObjectList(this); @@ -1105,7 +1105,7 @@ void ObjectList::sendScriptLocalShort() for (const auto &baseObject : baseObjects) LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s-%i, index: %i, shortVal: %i", baseObject.refId.c_str(), - baseObject.refNumIndex, baseObject.index, baseObject.shortVal); + baseObject.refNum, baseObject.index, baseObject.shortVal); mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_LOCAL_SHORT)->setObjectList(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_LOCAL_SHORT)->Send(); @@ -1117,7 +1117,7 @@ void ObjectList::sendScriptLocalFloat() for (const auto &baseObject : baseObjects) LOG_APPEND(Log::LOG_VERBOSE, "- cellRef: %s-%i, index: %i, floatVal: %f", baseObject.refId.c_str(), - baseObject.refNumIndex, baseObject.index, baseObject.floatVal); + baseObject.refNum, baseObject.index, baseObject.floatVal); mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_LOCAL_FLOAT)->setObjectList(this); mwmp::Main::get().getNetworking()->getObjectPacket(ID_SCRIPT_LOCAL_FLOAT)->Send(); diff --git a/apps/openmw/mwmp/PlayerList.cpp b/apps/openmw/mwmp/PlayerList.cpp index e07c16b07..9860f98aa 100644 --- a/apps/openmw/mwmp/PlayerList.cpp +++ b/apps/openmw/mwmp/PlayerList.cpp @@ -85,7 +85,7 @@ bool PlayerList::isDedicatedPlayer(const MWWorld::Ptr &ptr) if (ptr.mRef == nullptr) return false; - // Players always have 0 as their refNumIndex and mpNum + // Players always have 0 as their refNum and mpNum if (ptr.getCellRef().getRefNum().mIndex != 0 || ptr.getCellRef().getMpNum() != 0) return false; diff --git a/apps/openmw/mwscript/aiextensions.cpp b/apps/openmw/mwscript/aiextensions.cpp index b48a94e1a..86af5249f 100644 --- a/apps/openmw/mwscript/aiextensions.cpp +++ b/apps/openmw/mwscript/aiextensions.cpp @@ -345,13 +345,13 @@ namespace MWScript if (targetPtr) { mwmp::BaseActor baseActor; - baseActor.refNumIndex = ptr.getCellRef().getRefNum().mIndex; + baseActor.refNum = ptr.getCellRef().getRefNum().mIndex; baseActor.mpNum = ptr.getCellRef().getMpNum(); baseActor.aiAction = mwmp::BaseActorList::FOLLOW; baseActor.aiTarget = MechanicsHelper::getTarget(targetPtr); LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Sending ID_ACTOR_AI about %s %i-%i to server", - ptr.getCellRef().getRefId(), baseActor.refNumIndex, baseActor.mpNum); + ptr.getCellRef().getRefId(), baseActor.refNum, baseActor.mpNum); if (baseActor.aiTarget.isPlayer) { @@ -361,7 +361,7 @@ namespace MWScript else { LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "- Following actor %s %i-%i", - targetPtr.getCellRef().getRefId(), baseActor.aiTarget.refNumIndex, baseActor.aiTarget.mpNum); + targetPtr.getCellRef().getRefId(), baseActor.aiTarget.refNum, baseActor.aiTarget.mpNum); } mwmp::ActorList *actorList = mwmp::Main::get().getNetworking()->getActorList(); diff --git a/apps/openmw/mwworld/cellstore.cpp b/apps/openmw/mwworld/cellstore.cpp index 624309195..db7cf7c45 100644 --- a/apps/openmw/mwworld/cellstore.cpp +++ b/apps/openmw/mwworld/cellstore.cpp @@ -502,12 +502,12 @@ namespace MWWorld struct SearchExactVisitor { PtrType mFound; - unsigned int mRefNumIndexToFind; + unsigned int mRefNumToFind; unsigned int mMpNumToFind; bool operator()(const PtrType& ptr) { - if (ptr.getCellRef().getRefNum().mIndex == mRefNumIndexToFind && ptr.getCellRef().getMpNum() == mMpNumToFind) + if (ptr.getCellRef().getRefNum().mIndex == mRefNumToFind && ptr.getCellRef().getMpNum() == mMpNumToFind) { mFound = ptr; return false; @@ -524,14 +524,14 @@ namespace MWWorld Allow the searching of objects by their reference numbers */ - Ptr CellStore::searchExact (unsigned int refNumIndex, unsigned int mpNum) + Ptr CellStore::searchExact (unsigned int refNum, unsigned int mpNum) { // Ensure that all objects searched for have a valid reference number - if (refNumIndex == 0 && mpNum == 0) + if (refNum == 0 && mpNum == 0) return 0; SearchExactVisitor searchVisitor; - searchVisitor.mRefNumIndexToFind = refNumIndex; + searchVisitor.mRefNumToFind = refNum; searchVisitor.mMpNumToFind = mpNum; forEach(searchVisitor); return searchVisitor.mFound; diff --git a/apps/openmw/mwworld/cellstore.hpp b/apps/openmw/mwworld/cellstore.hpp index 33e629ea0..f6cfc6c21 100644 --- a/apps/openmw/mwworld/cellstore.hpp +++ b/apps/openmw/mwworld/cellstore.hpp @@ -234,7 +234,7 @@ namespace MWWorld Allow the searching of objects by their reference numbers */ - Ptr searchExact (unsigned int refNumIndex, unsigned int mpNum); + Ptr searchExact (unsigned int refNum, unsigned int mpNum); /* End of tes3mp addition */ diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index cf91ca57b..ed932ef0b 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -732,16 +732,16 @@ namespace MWWorld /* Start of tes3mp addition - Make it possible to find a Ptr in any active cell based on its refNumIndex and mpNum + Make it possible to find a Ptr in any active cell based on its refNum and mpNum */ - Ptr World::searchPtrViaRefIndex(int refNumIndex, int mpNum) + Ptr World::searchPtrViaRefIndex(int refNum, int mpNum) { for (Scene::CellStoreCollection::const_iterator iter(mWorldScene->getActiveCells().begin()); iter != mWorldScene->getActiveCells().end(); ++iter) { CellStore* cellStore = *iter; - MWWorld::Ptr ptrFound = cellStore->searchExact(refNumIndex, mpNum); + MWWorld::Ptr ptrFound = cellStore->searchExact(refNum, mpNum); if (ptrFound) return ptrFound; diff --git a/apps/openmw/mwworld/worldimp.hpp b/apps/openmw/mwworld/worldimp.hpp index 223cd777f..589c44ae9 100644 --- a/apps/openmw/mwworld/worldimp.hpp +++ b/apps/openmw/mwworld/worldimp.hpp @@ -294,9 +294,9 @@ namespace MWWorld /* Start of tes3mp addition - Make it possible to find a Ptr in any active cell based on its refNumIndex and mpNum + Make it possible to find a Ptr in any active cell based on its refNum and mpNum */ - Ptr searchPtrViaRefIndex(int refNumIndex, int mpNum) override; + Ptr searchPtrViaRefIndex(int refNum, int mpNum) override; /* End of tes3mp addition */ diff --git a/components/openmw-mp/Base/BaseActor.hpp b/components/openmw-mp/Base/BaseActor.hpp index 560c14f33..0474104ea 100644 --- a/components/openmw-mp/Base/BaseActor.hpp +++ b/components/openmw-mp/Base/BaseActor.hpp @@ -20,7 +20,7 @@ namespace mwmp } std::string refId; - int refNumIndex; + int refNum; int mpNum; ESM::Position position; diff --git a/components/openmw-mp/Base/BaseObject.hpp b/components/openmw-mp/Base/BaseObject.hpp index 3c4e143e8..d358af474 100644 --- a/components/openmw-mp/Base/BaseObject.hpp +++ b/components/openmw-mp/Base/BaseObject.hpp @@ -25,7 +25,7 @@ namespace mwmp struct BaseObject { std::string refId; - int refNumIndex; + int refNum; int mpNum; int count; int charge; diff --git a/components/openmw-mp/Base/BasePlayer.hpp b/components/openmw-mp/Base/BasePlayer.hpp index 33e48f0b9..259ac6e87 100644 --- a/components/openmw-mp/Base/BasePlayer.hpp +++ b/components/openmw-mp/Base/BasePlayer.hpp @@ -18,7 +18,7 @@ namespace mwmp struct CurrentContainer { std::string refId; - unsigned int refNumIndex; + unsigned int refNum; unsigned int mpNum; bool loot; }; diff --git a/components/openmw-mp/Base/BaseStructs.hpp b/components/openmw-mp/Base/BaseStructs.hpp index e64e50733..25d8106a4 100644 --- a/components/openmw-mp/Base/BaseStructs.hpp +++ b/components/openmw-mp/Base/BaseStructs.hpp @@ -27,7 +27,7 @@ namespace mwmp bool isPlayer; std::string refId; - int refNumIndex; + int refNum; int mpNum; std::string name; // Remove this once the server can get names corresponding to different refIds diff --git a/components/openmw-mp/Packets/Actor/ActorPacket.cpp b/components/openmw-mp/Packets/Actor/ActorPacket.cpp index 38eca39a7..2e767c3d9 100644 --- a/components/openmw-mp/Packets/Actor/ActorPacket.cpp +++ b/components/openmw-mp/Packets/Actor/ActorPacket.cpp @@ -37,7 +37,7 @@ void ActorPacket::Packet(RakNet::BitStream *bs, bool send) if (send) actor = actorList->baseActors.at(i); - RW(actor.refNumIndex, send); + RW(actor.refNum, send); RW(actor.mpNum, send); Actor(actor, send); diff --git a/components/openmw-mp/Packets/Actor/PacketActorAI.cpp b/components/openmw-mp/Packets/Actor/PacketActorAI.cpp index 4f5022dfe..3c24383a3 100644 --- a/components/openmw-mp/Packets/Actor/PacketActorAI.cpp +++ b/components/openmw-mp/Packets/Actor/PacketActorAI.cpp @@ -43,7 +43,7 @@ void PacketActorAI::Actor(BaseActor &actor, bool send) else { RW(actor.aiTarget.refId, send, true); - RW(actor.aiTarget.refNumIndex, send); + RW(actor.aiTarget.refNum, send); RW(actor.aiTarget.mpNum, send); } } diff --git a/components/openmw-mp/Packets/Actor/PacketActorAttack.cpp b/components/openmw-mp/Packets/Actor/PacketActorAttack.cpp index 4c12d6ac7..7349f72e5 100644 --- a/components/openmw-mp/Packets/Actor/PacketActorAttack.cpp +++ b/components/openmw-mp/Packets/Actor/PacketActorAttack.cpp @@ -20,7 +20,7 @@ void PacketActorAttack::Actor(BaseActor &actor, bool send) else { RW(actor.attack.target.refId, send, true); - RW(actor.attack.target.refNumIndex, send); + RW(actor.attack.target.refNum, send); RW(actor.attack.target.mpNum, send); } diff --git a/components/openmw-mp/Packets/Actor/PacketActorDeath.cpp b/components/openmw-mp/Packets/Actor/PacketActorDeath.cpp index 8d55e287d..efa356c72 100644 --- a/components/openmw-mp/Packets/Actor/PacketActorDeath.cpp +++ b/components/openmw-mp/Packets/Actor/PacketActorDeath.cpp @@ -20,7 +20,7 @@ void PacketActorDeath::Actor(BaseActor &actor, bool send) else { RW(actor.killer.refId, send, true); - RW(actor.killer.refNumIndex, send); + RW(actor.killer.refNum, send); RW(actor.killer.mpNum, send); RW(actor.killer.name, send, true); diff --git a/components/openmw-mp/Packets/Actor/PacketActorList.cpp b/components/openmw-mp/Packets/Actor/PacketActorList.cpp index 6d3077336..382d8e82c 100644 --- a/components/openmw-mp/Packets/Actor/PacketActorList.cpp +++ b/components/openmw-mp/Packets/Actor/PacketActorList.cpp @@ -23,10 +23,10 @@ void PacketActorList::Packet(RakNet::BitStream *bs, bool send) actor = actorList->baseActors.at(i); RW(actor.refId, send); - RW(actor.refNumIndex, send); + RW(actor.refNum, send); RW(actor.mpNum, send); - if (actor.refId.empty() || (actor.refNumIndex != 0 && actor.mpNum != 0)) + if (actor.refId.empty() || (actor.refNum != 0 && actor.mpNum != 0)) { actorList->isValid = false; return; diff --git a/components/openmw-mp/Packets/Object/ObjectPacket.cpp b/components/openmw-mp/Packets/Object/ObjectPacket.cpp index 053938b4f..3b2dc2f6e 100644 --- a/components/openmw-mp/Packets/Object/ObjectPacket.cpp +++ b/components/openmw-mp/Packets/Object/ObjectPacket.cpp @@ -73,6 +73,6 @@ bool ObjectPacket::PacketHeader(RakNet::BitStream *bs, bool send) void ObjectPacket::Object(BaseObject &baseObject, bool send) { RW(baseObject.refId, send); - RW(baseObject.refNumIndex, send); + RW(baseObject.refNum, send); RW(baseObject.mpNum, send); } diff --git a/components/openmw-mp/Packets/Object/PacketContainer.cpp b/components/openmw-mp/Packets/Object/PacketContainer.cpp index e01802cfb..55049b8bf 100644 --- a/components/openmw-mp/Packets/Object/PacketContainer.cpp +++ b/components/openmw-mp/Packets/Object/PacketContainer.cpp @@ -33,7 +33,7 @@ void PacketContainer::Packet(RakNet::BitStream *bs, bool send) RW(baseObject.containerItemCount, send); - if (baseObject.containerItemCount > maxObjects || baseObject.refId.empty() || (baseObject.refNumIndex != 0 && baseObject.mpNum != 0)) + if (baseObject.containerItemCount > maxObjects || baseObject.refId.empty() || (baseObject.refNum != 0 && baseObject.mpNum != 0)) { objectList->isValid = false; return; diff --git a/components/openmw-mp/Packets/Object/PacketObjectSpawn.cpp b/components/openmw-mp/Packets/Object/PacketObjectSpawn.cpp index eb93b3558..f92ca7dc7 100644 --- a/components/openmw-mp/Packets/Object/PacketObjectSpawn.cpp +++ b/components/openmw-mp/Packets/Object/PacketObjectSpawn.cpp @@ -28,7 +28,7 @@ void PacketObjectSpawn::Object(BaseObject &baseObject, bool send) else { RW(baseObject.master.refId, send, true); - RW(baseObject.master.refNumIndex, send); + RW(baseObject.master.refNum, send); RW(baseObject.master.mpNum, send); } } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerAttack.cpp b/components/openmw-mp/Packets/Player/PacketPlayerAttack.cpp index 2aa17e61c..f956de5af 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerAttack.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerAttack.cpp @@ -21,7 +21,7 @@ void PacketPlayerAttack::Packet(RakNet::BitStream *bs, bool send) else { RW(player->attack.target.refId, send, true); - RW(player->attack.target.refNumIndex, send); + RW(player->attack.target.refNum, send); RW(player->attack.target.mpNum, send); } diff --git a/components/openmw-mp/Packets/Player/PacketPlayerDeath.cpp b/components/openmw-mp/Packets/Player/PacketPlayerDeath.cpp index 8e0e5e511..989b7a603 100644 --- a/components/openmw-mp/Packets/Player/PacketPlayerDeath.cpp +++ b/components/openmw-mp/Packets/Player/PacketPlayerDeath.cpp @@ -21,7 +21,7 @@ void PacketPlayerDeath::Packet(RakNet::BitStream *bs, bool send) else { RW(player->killer.refId, send, true); - RW(player->killer.refNumIndex, send); + RW(player->killer.refNum, send); RW(player->killer.mpNum, send); RW(player->killer.name, send, true);