diff --git a/apps/openmw-mp/Player.cpp b/apps/openmw-mp/Player.cpp index e2a9bcbf4..a398c9138 100644 --- a/apps/openmw-mp/Player.cpp +++ b/apps/openmw-mp/Player.cpp @@ -746,7 +746,7 @@ std::tuple Player::getPreviousCellPos() const void Player::resurrect(unsigned int type) { - resurrectType = type; + resurrectType = static_cast(type); auto packet = mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_RESURRECT); packet->setPlayer(this); diff --git a/apps/openmw/mwmp/processors/player/ProcessorPlayerResurrect.hpp b/apps/openmw/mwmp/processors/player/ProcessorPlayerResurrect.hpp index fd7aea9b4..f70554c2e 100644 --- a/apps/openmw/mwmp/processors/player/ProcessorPlayerResurrect.hpp +++ b/apps/openmw/mwmp/processors/player/ProcessorPlayerResurrect.hpp @@ -25,16 +25,26 @@ namespace mwmp if (isLocal()) { - LOG_APPEND(Log::LOG_INFO, "- Packet was about me with resurrectType of %i", player->resurrectType); + LOG_APPEND(Log::LOG_INFO, "- Packet was about me with resurrectType of %i", (int) player->resurrectType); player->creatureStats.mDead = false; - - MWWorld::Ptr playerPtr = MWBase::Environment::get().getWorld()->getPlayerPtr(); - if (player->resurrectType == mwmp::RESURRECT_TYPE::IMPERIAL_SHRINE) - MWBase::Environment::get().getWorld()->teleportToClosestMarker(playerPtr, "divinemarker"); - else if (player->resurrectType == mwmp::RESURRECT_TYPE::TRIBUNAL_TEMPLE) - MWBase::Environment::get().getWorld()->teleportToClosestMarker(playerPtr, "templemarker"); + MWBase::World *world = MWBase::Environment::get().getWorld(); + MWWorld::Ptr playerPtr = world->getPlayerPtr(); + + + switch(player->resurrectType) + { + case ResurrectType::Regular: + break; + case ResurrectType::ImperialShrine: + world->teleportToClosestMarker(playerPtr, "divinemarker"); + break; + case ResurrectType::TribunalTemple: + world->teleportToClosestMarker(playerPtr, "templemarker"); + break; + } + playerPtr.getClass().getCreatureStats(playerPtr).resurrect(); diff --git a/components/openmw-mp/Base/BasePlayer.hpp b/components/openmw-mp/Base/BasePlayer.hpp index ba05a2193..ccacef0f1 100644 --- a/components/openmw-mp/Base/BasePlayer.hpp +++ b/components/openmw-mp/Base/BasePlayer.hpp @@ -151,11 +151,11 @@ namespace mwmp std::vector cellStates; }; - enum RESURRECT_TYPE + enum class ResurrectType : uint8_t { - REGULAR = 0, - IMPERIAL_SHRINE, - TRIBUNAL_TEMPLE + Regular = 0, + ImperialShrine, + TribunalTemple }; class BasePlayer : public mwmp::BaseNetCreature @@ -285,7 +285,7 @@ namespace mwmp std::string jailProgressText; std::string jailEndText; - unsigned int resurrectType; + ResurrectType resurrectType; bool diedSinceArrestAttempt;