mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Players: fix null dereference crash
(cherry picked from commit c3176a8143)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user