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:
@@ -252,7 +252,7 @@ public:
|
||||
if (type == POINT_MOTION_TYPE && point == POINT_MOVE_TO_MIDNIGHT)
|
||||
{
|
||||
if (TempSummon* summon = me->ToTempSummon())
|
||||
if (Unit* midnight = summon->GetSummoner())
|
||||
if (Unit* midnight = summon->GetSummonerUnit())
|
||||
midnight->GetAI()->SetData(DATA_ATTUMEN_READY, 0);
|
||||
}
|
||||
}
|
||||
@@ -356,7 +356,7 @@ public:
|
||||
if (type == POINT_MOTION_TYPE && point == POINT_MOVE_TO_MIDNIGHT)
|
||||
{
|
||||
if (TempSummon* summon = me->ToTempSummon())
|
||||
if (Unit* midnight = summon->GetSummoner())
|
||||
if (Unit* midnight = summon->GetSummonerUnit())
|
||||
midnight->GetAI()->SetData(DATA_ATTUMEN_READY, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
Player* player = nullptr;
|
||||
if (me->IsSummon())
|
||||
{
|
||||
if (Unit * summoner = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit * summoner = me->ToTempSummon()->GetSummonerUnit())
|
||||
{
|
||||
player = summoner->ToPlayer();
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ public:
|
||||
return;
|
||||
|
||||
if (TempSummon* summon = me->ToTempSummon())
|
||||
if (Unit* creature = summon->GetSummoner())
|
||||
if (Unit* creature = summon->GetSummonerUnit())
|
||||
creature->GetAI()->DoAction(1);
|
||||
|
||||
me->DespawnOrUnsummon(1);
|
||||
@@ -274,7 +274,7 @@ public:
|
||||
void JustDied(Unit*) override
|
||||
{
|
||||
if (TempSummon* summon = me->ToTempSummon())
|
||||
if (Unit* creature = summon->GetSummoner())
|
||||
if (Unit* creature = summon->GetSummonerUnit())
|
||||
creature->GetAI()->DoAction(2);
|
||||
}
|
||||
|
||||
|
||||
@@ -299,7 +299,7 @@ public:
|
||||
|
||||
if (me->IsSummon())
|
||||
{
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummonerUnit())
|
||||
{
|
||||
if (summoner->GetTypeId() == TYPEID_UNIT && summoner->IsAlive() && !summoner->IsInCombat())
|
||||
summoner->ToCreature()->AI()->AttackStart(who);
|
||||
@@ -313,7 +313,7 @@ public:
|
||||
|
||||
if (me->IsSummon())
|
||||
{
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummonerUnit())
|
||||
{
|
||||
if (summoner->GetTypeId() == TYPEID_UNIT && summoner->IsAlive())
|
||||
summoner->ToCreature()->DisappearAndDie();
|
||||
@@ -328,7 +328,7 @@ public:
|
||||
|
||||
if (me->IsSummon())
|
||||
{
|
||||
Unit* summoner = me->ToTempSummon()->GetSummoner();
|
||||
Unit* summoner = me->ToTempSummon()->GetSummonerUnit();
|
||||
if (summoner && summoner->GetTypeId() == TYPEID_UNIT && summoner->IsAIEnabled)
|
||||
{
|
||||
npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI* ai =
|
||||
|
||||
Reference in New Issue
Block a user