mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 18:10:26 +00:00
Improved OnCriteriaCheck hook, passing information about criteria_id
OnCheck without criteria_id is deprecated but still available
This commit is contained in:
@@ -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 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user