mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +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
|
void InitializeAI() override
|
||||||
{
|
{
|
||||||
if (Unit* owner = me->ToTempSummon()->GetSummonerUnit())
|
if (TempSummon* tempSummon = me->ToTempSummon())
|
||||||
{
|
{
|
||||||
uint32 hp = uint32(owner->GetMaxHealth() * 0.3f);
|
if (Unit* owner = tempSummon->GetSummonerUnit())
|
||||||
me->SetMaxHealth(hp);
|
{
|
||||||
me->SetHealth(hp);
|
uint32 hp = uint32(owner->GetMaxHealth() * 0.3f);
|
||||||
me->SetLevel(owner->GetLevel());
|
me->SetMaxHealth(hp);
|
||||||
|
me->SetHealth(hp);
|
||||||
|
me->SetLevel(owner->GetLevel());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
me->CastSpell(me, SPELL_PRIEST_LIGHTWELL_CHARGES, false); // Spell for Lightwell Charges
|
me->CastSpell(me, SPELL_PRIEST_LIGHTWELL_CHARGES, false); // Spell for Lightwell Charges
|
||||||
|
|||||||
Reference in New Issue
Block a user