[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)
{
resurrectType = type;
resurrectType = static_cast<mwmp::ResurrectType>(type);
auto packet = mwmp::Networking::get().getPlayerPacketController()->GetPacket(ID_PLAYER_RESURRECT);
packet->setPlayer(this);

@ -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();

@ -151,11 +151,11 @@ namespace mwmp
std::vector<CellState> 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;

Loading…
Cancel
Save