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:
@@ -283,6 +283,9 @@ class achievement_king_dred : public AchievementCriteriaScript
|
||||
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
if (Creature* Dred = target->ToCreature())
|
||||
if (Dred->AI()->GetData(DATA_KING_DRED) >= 6)
|
||||
return true;
|
||||
|
||||
@@ -352,6 +352,9 @@ class achievement_oh_novos : public AchievementCriteriaScript
|
||||
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
if (Creature* Novos = target->ToCreature())
|
||||
if (Novos->AI()->GetData(DATA_OH_NOVOS))
|
||||
return true;
|
||||
|
||||
@@ -204,6 +204,9 @@ class achievement_consumption_junction : public AchievementCriteriaScript
|
||||
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
if (Creature* Trollgore = target->ToCreature())
|
||||
if (Trollgore->AI()->GetData(DATA_CONSUMPTION_JUNCTION))
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user