mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Conditions: Allow NegativeCondition for references (#30363)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user