diff --git a/apps/openmw-mp/Actors.cpp b/apps/openmw-mp/Actors.cpp index 1f7f379e4..ffe0090ae 100644 --- a/apps/openmw-mp/Actors.cpp +++ b/apps/openmw-mp/Actors.cpp @@ -239,7 +239,7 @@ void ActorController::sendList(std::shared_ptr player, std::vectorcell; actorList.guid = player->guid; - actorList.action = mwmp::BaseActorList::SET; + actorList.action = mwmp::BaseActorList::Action::Set; for (auto &actor : actors) { @@ -257,7 +257,7 @@ void ActorController::requestList(std::shared_ptr player, const ESM::Cel { actorList.cell = player->cell; actorList.guid = player->guid; - actorList.action = mwmp::BaseActorList::REQUEST; + actorList.action = mwmp::BaseActorList::Action::Request; auto packet = mwmp::Networking::get().getActorPacketController()->GetPacket(ID_ACTOR_LIST); packet->setActorList(&actorList); @@ -270,9 +270,9 @@ std::vector> ActorController::getActors(std::shared_ptr

> actorList; - for (auto actor : serverCell->getActorList()->baseActors) + for (const auto &actor : serverCell->getActorList()->baseActors) { - Actor *a = new Actor; + auto a = new Actor; a->actor = actor; actorList.emplace_back(a); } diff --git a/apps/openmw/mwmp/ActorList.cpp b/apps/openmw/mwmp/ActorList.cpp index 5c8f5a354..3c96ebb5f 100644 --- a/apps/openmw/mwmp/ActorList.cpp +++ b/apps/openmw/mwmp/ActorList.cpp @@ -172,7 +172,7 @@ void ActorList::sendActorsInCell(MWWorld::CellStore* cellStore) { reset(); cell = *cellStore->getCell(); - action = BaseActorList::SET; + action = BaseActorList::Action::Set; auto createActor = [](const MWWorld::Ptr &ptr){ BaseActor *actor = new BaseActor; diff --git a/apps/openmw/mwmp/processors/actor/ProcessorActorList.hpp b/apps/openmw/mwmp/processors/actor/ProcessorActorList.hpp index 41ab06c78..556c98bbc 100644 --- a/apps/openmw/mwmp/processors/actor/ProcessorActorList.hpp +++ b/apps/openmw/mwmp/processors/actor/ProcessorActorList.hpp @@ -23,10 +23,10 @@ namespace mwmp if (!ptrCellStore) return; LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Received %s about %s", strPacketID.c_str(), actorList.cell.getDescription().c_str()); - LOG_APPEND(Log::LOG_VERBOSE, "- action: %i", actorList.action); + LOG_APPEND(Log::LOG_VERBOSE, "- action: %i", (int) actorList.action); // If we've received a request for information, comply with it - if (actorList.action == mwmp::BaseActorList::REQUEST) + if (actorList.action == mwmp::BaseActorList::Action::Request) { MechanicsHelper::spawnLeveledCreatures(ptrCellStore); actorList.sendActorsInCell(ptrCellStore); diff --git a/components/openmw-mp/Base/BaseActor.hpp b/components/openmw-mp/Base/BaseActor.hpp index 64f2fa460..f86ede32a 100644 --- a/components/openmw-mp/Base/BaseActor.hpp +++ b/components/openmw-mp/Base/BaseActor.hpp @@ -46,12 +46,12 @@ namespace mwmp cell.blank(); } - enum ACTOR_ACTION + enum class Action: uint8_t { - SET = 0, - ADD = 1, - REMOVE = 2, - REQUEST = 3 + Set = 0, + Add, + Remsove, + Request }; RakNet::RakNetGUID guid; @@ -60,7 +60,7 @@ namespace mwmp ESM::Cell cell; - unsigned char action; // 0 - Clear and set in entirety, 1 - Add item, 2 - Remove item, 3 - Request items + Action action; bool isValid; }; diff --git a/components/openmw-mp/Base/BasePlayer.hpp b/components/openmw-mp/Base/BasePlayer.hpp index 7e42f711a..38c7ca42c 100644 --- a/components/openmw-mp/Base/BasePlayer.hpp +++ b/components/openmw-mp/Base/BasePlayer.hpp @@ -21,7 +21,7 @@ namespace mwmp { struct Chat { - enum class Action : uint8_t { + enum class Action: uint8_t { print = 0, clear, addchannel, @@ -46,7 +46,7 @@ namespace mwmp { std::string quest; int index; - enum class Type + enum class Type: uint8_t { Entry = 0, Index = 1 @@ -85,7 +85,7 @@ namespace mwmp { std::string itemId; - enum class Type : uint8_t + enum class Type: uint8_t { Item = 0, Magic,