aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/Entities/Player/Player.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 713b2a860f9..939d7e750d1 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -25390,18 +25390,24 @@ void Player::ResurrectUsingRequestData()
void Player::ResurrectUsingRequestDataImpl()
{
+ // save health and mana before resurrecting, _resurrectionData can be erased
+ uint32 resurrectHealth = _resurrectionData->Health;
+ uint32 resurrectMana = _resurrectionData->Mana;
+ uint32 resurrectAura = _resurrectionData->Aura;
+ ObjectGuid resurrectGUID = _resurrectionData->GUID;
+
ResurrectPlayer(0.0f, false);
- SetHealth(_resurrectionData->Health);
- SetPower(POWER_MANA, _resurrectionData->Mana);
+ SetHealth(resurrectHealth);
+ SetPower(POWER_MANA, resurrectMana);
SetPower(POWER_RAGE, 0);
SetFullPower(POWER_ENERGY);
SetFullPower(POWER_FOCUS);
SetPower(POWER_LUNAR_POWER, 0);
- if (uint32 aura = _resurrectionData->Aura)
- CastSpell(this, aura, true, nullptr, nullptr, _resurrectionData->GUID);
+ if (uint32 aura = resurrectAura)
+ CastSpell(this, aura, true, nullptr, nullptr, resurrectGUID);
SpawnCorpseBones();
}