mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 10:00:28 +00:00
fix(Scripts/Pet): Fix crash when spawning lightwell by hand (#18660)
Co-authored-by: Pagani Walter <paganiwalter@gmail.com>
This commit is contained in:
@@ -40,12 +40,15 @@ struct npc_pet_pri_lightwell : public TotemAI
|
||||
|
||||
void InitializeAI() override
|
||||
{
|
||||
if (Unit* owner = me->ToTempSummon()->GetSummonerUnit())
|
||||
if (TempSummon* tempSummon = me->ToTempSummon())
|
||||
{
|
||||
uint32 hp = uint32(owner->GetMaxHealth() * 0.3f);
|
||||
me->SetMaxHealth(hp);
|
||||
me->SetHealth(hp);
|
||||
me->SetLevel(owner->GetLevel());
|
||||
if (Unit* owner = tempSummon->GetSummonerUnit())
|
||||
{
|
||||
uint32 hp = uint32(owner->GetMaxHealth() * 0.3f);
|
||||
me->SetMaxHealth(hp);
|
||||
me->SetHealth(hp);
|
||||
me->SetLevel(owner->GetLevel());
|
||||
}
|
||||
}
|
||||
|
||||
me->CastSpell(me, SPELL_PRIEST_LIGHTWELL_CHARGES, false); // Spell for Lightwell Charges
|
||||
|
||||
Reference in New Issue
Block a user