Scripts/Achievements: Fixed a crash in Heigan's achievement script & more possible crashes & small improvements to handling datas for achievements
This commit is contained in:
@@ -1707,6 +1707,9 @@ class achievement_twilight_assist : public AchievementCriteriaScript
|
||||
|
||||
bool OnCheck(Player* player, Unit* target)
|
||||
{
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
if (Creature* Sartharion = target->ToCreature())
|
||||
if (Sartharion->AI()->GetData(TWILIGHT_ACHIEVEMENTS) >= 1)
|
||||
return true;
|
||||
@@ -1724,6 +1727,9 @@ class achievement_twilight_duo : public AchievementCriteriaScript
|
||||
|
||||
bool OnCheck(Player* player, Unit* target)
|
||||
{
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
if (Creature* Sartharion = target->ToCreature())
|
||||
if (Sartharion->AI()->GetData(TWILIGHT_ACHIEVEMENTS) >= 2)
|
||||
return true;
|
||||
@@ -1741,6 +1747,9 @@ class achievement_twilight_zone : public AchievementCriteriaScript
|
||||
|
||||
bool OnCheck(Player* player, Unit* target)
|
||||
{
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
if (Creature* Sartharion = target->ToCreature())
|
||||
if (Sartharion->AI()->GetData(TWILIGHT_ACHIEVEMENTS) == 3)
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user