diff options
author | Meji <alvaro.megias@outlook.com> | 2024-10-19 15:20:34 +0200 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2024-10-21 21:58:59 +0200 |
commit | 40419f91d15b562be2550ec58c2c0b01f6a0a8de (patch) | |
tree | b4cf7ad0aa5f3cc8870d569851e28f195bc182c5 | |
parent | a0d9398ab5a61734e6dc938f1bc1d5c6e91d25fd (diff) |
Core/Conditions: Allow NegativeCondition for references (#30363)
(cherry picked from commit b860733822aebef4bd69d506d32e44c0de9f7789)
-rw-r--r-- | src/server/game/Conditions/ConditionMgr.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 7cd75eb0f0c..ff64271c59a 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -1014,7 +1014,11 @@ bool ConditionMgr::IsObjectMeetToConditionList(ConditionSourceInfo& sourceInfo, auto ref = ConditionStore[CONDITION_SOURCE_TYPE_REFERENCE_CONDITION].find({ condition.ReferenceId, 0, 0 }); if (ref != ConditionStore[CONDITION_SOURCE_TYPE_REFERENCE_CONDITION].end()) { - if (!IsObjectMeetToConditionList(sourceInfo, *ref->second)) + bool condMeets = IsObjectMeetToConditionList(sourceInfo, *ref->second); + if (condition.NegativeCondition) + condMeets = !condMeets; + + if (!condMeets) itr->second = false; } else @@ -1337,8 +1341,6 @@ void ConditionMgr::LoadConditions(bool isReload) TC_LOG_ERROR("sql.sql", "Condition {} {} has useless data in value2 ({})!", rowType, iSourceTypeOrReferenceId, cond.ConditionValue2); if (cond.ConditionValue3) TC_LOG_ERROR("sql.sql", "Condition {} {} has useless data in value3 ({})!", rowType, iSourceTypeOrReferenceId, cond.ConditionValue3); - if (cond.NegativeCondition) - TC_LOG_ERROR("sql.sql", "Condition {} {} has useless data in NegativeCondition ({})!", rowType, iSourceTypeOrReferenceId, cond.NegativeCondition); } else if (!isConditionTypeValid(&cond))//doesn't have reference, validate ConditionType continue; |