mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-31 01:23:47 +00:00
fix(Core/Misc): bunch of crashfixes (#7307)
This commit is contained in:
@@ -281,7 +281,7 @@ public:
|
||||
Creature* GetSummoner()
|
||||
{
|
||||
if (me->IsSummon())
|
||||
if (Unit* coren = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit* coren = me->ToTempSummon()->GetSummonerUnit())
|
||||
return coren->ToCreature();
|
||||
|
||||
return nullptr;
|
||||
|
||||
@@ -1274,7 +1274,7 @@ public:
|
||||
Unit* GetOwner()
|
||||
{
|
||||
if (me->ToTempSummon())
|
||||
return me->ToTempSummon()->GetSummoner();
|
||||
return me->ToTempSummon()->GetSummonerUnit();
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ public:
|
||||
if (Talk(actionCounter))
|
||||
{
|
||||
if (me->ToTempSummon())
|
||||
if (Unit* owner = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit* owner = me->ToTempSummon()->GetSummonerUnit())
|
||||
me->CastSpell(owner, SPELL_SNIVEL_GUN, true);
|
||||
|
||||
me->DespawnOrUnsummon(1000);
|
||||
|
||||
@@ -296,7 +296,7 @@ public:
|
||||
case SPELL_VISUAL_THROW_CRANBERRY:
|
||||
case SPELL_VISUAL_THROW_SWEET_POTATO:
|
||||
if (TempSummon* ts = me->ToTempSummon())
|
||||
if (Unit* owner = ts->GetSummoner())
|
||||
if (Unit* owner = ts->GetSummonerUnit())
|
||||
owner->ToCreature()->AI()->DoAction(spellInfo->Id);
|
||||
break;
|
||||
}
|
||||
@@ -376,7 +376,7 @@ public:
|
||||
else
|
||||
{
|
||||
if (TempSummon* ts = target->ToTempSummon())
|
||||
if (Unit* owner = ts->GetSummoner())
|
||||
if (Unit* owner = ts->GetSummonerUnit())
|
||||
if (owner->GetEntry() == GetCaster()->GetEntry())
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user