[General] Change type of BasePlayer::resurrectType to ResurrectType

sol2-server-rewrite
Koncord 7 years ago
parent f9c4b847aa
commit 077a3d06b3

@ -746,7 +746,7 @@ std::tuple<float, float, float> Player::getPreviousCellPos() const
void Player::resurrect(unsigned int type) void Player::resurrect(unsigned int type)
{ {
resurrectType = type; resurrectType = static_cast<mwmp::ResurrectType>(type);
auto packet = mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_RESURRECT); auto packet = mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_RESURRECT);
packet->setPlayer(this); packet->setPlayer(this);

@ -25,16 +25,26 @@ namespace mwmp
if (isLocal()) 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; player->creatureStats.mDead = false;
MWWorld::Ptr playerPtr = MWBase::Environment::get().getWorld()->getPlayerPtr();
if (player->resurrectType == mwmp::RESURRECT_TYPE::IMPERIAL_SHRINE) MWBase::World *world = MWBase::Environment::get().getWorld();
MWBase::Environment::get().getWorld()->teleportToClosestMarker(playerPtr, "divinemarker"); MWWorld::Ptr playerPtr = world->getPlayerPtr();
else if (player->resurrectType == mwmp::RESURRECT_TYPE::TRIBUNAL_TEMPLE)
MWBase::Environment::get().getWorld()->teleportToClosestMarker(playerPtr, "templemarker");
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(); playerPtr.getClass().getCreatureStats(playerPtr).resurrect();

@ -151,11 +151,11 @@ namespace mwmp
std::vector<CellState> cellStates; std::vector<CellState> cellStates;
}; };
enum RESURRECT_TYPE enum class ResurrectType : uint8_t
{ {
REGULAR = 0, Regular = 0,
IMPERIAL_SHRINE, ImperialShrine,
TRIBUNAL_TEMPLE TribunalTemple
}; };
class BasePlayer : public mwmp::BaseNetCreature class BasePlayer : public mwmp::BaseNetCreature
@ -285,7 +285,7 @@ namespace mwmp
std::string jailProgressText; std::string jailProgressText;
std::string jailEndText; std::string jailEndText;
unsigned int resurrectType; ResurrectType resurrectType;
bool diedSinceArrestAttempt; bool diedSinceArrestAttempt;

Loading…
Cancel
Save