Improved OnCriteriaCheck hook, passing information about criteria_id

OnCheck without criteria_id is deprecated but still available
This commit is contained in:
Yehonal
2017-11-03 11:28:06 +00:00
parent 563e02370e
commit 1e288af897
3 changed files with 9 additions and 5 deletions

View File

@@ -747,7 +747,11 @@ class AchievementCriteriaScript : public ScriptObject
bool IsDatabaseBound() const { return true; }
// Called when an additional criteria is checked.
virtual bool OnCheck(Player* source, Unit* target) = 0;
virtual bool OnCheck(Player* source, Unit* target, uint32 /*criteria_id*/) {
return OnCheck(source, target);
}
// deprecated/legacy
virtual bool OnCheck(Player* /*source*/, Unit* /*target*/) { return true; };
};
class PlayerScript : public ScriptObject
@@ -1176,7 +1180,7 @@ class ScriptMgr
public: /* AchievementCriteriaScript */
bool OnCriteriaCheck(uint32 scriptId, Player* source, Unit* target);
bool OnCriteriaCheck(uint32 scriptId, Player* source, Unit* target, uint32 criteria_id);
public: /* PlayerScript */