diff options
author | Shauren <shauren.trinity@gmail.com> | 2019-07-21 17:12:34 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2019-07-21 17:12:34 +0200 |
commit | ff334ae707eeebacc6d5c4fd26df71e4eb4d732a (patch) | |
tree | a595444cbdbc8107431308555a862dead54d535d /src/server/game/Conditions/ConditionMgr.cpp | |
parent | 3058d8c5ab50aa648a028fa38e64e1b72ae9305a (diff) |
Core/Conditions: Reimplemented CONDITION_OBJECT_ENTRY_GUID and CONDITION_TYPE_MASK under new values to allow easier porting conditions between branches. Old data is dynamically converted during startup
Diffstat (limited to 'src/server/game/Conditions/ConditionMgr.cpp')
-rw-r--r-- | src/server/game/Conditions/ConditionMgr.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index c3496ae356e..37c2e980459 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -122,7 +122,10 @@ ConditionMgr::ConditionTypeInfo const ConditionMgr::StaticConditionTypeData[COND { "On Taxi", false, false, false }, { "Quest state mask", true, true, false }, { "Objective Complete", true, false, false }, - { "Map Difficulty", true, false, false } + { "Map Difficulty", true, false, false }, + { nullptr, false, false, false }, + { "Object Entry or Guid", true, true, true }, + { "Object TypeMask", true, false, false }, }; // Checks if object meets the condition @@ -2084,6 +2087,10 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) const } break; } + case CONDITION_OBJECT_ENTRY_GUID_LEGACY: + cond->ConditionType = CONDITION_OBJECT_ENTRY_GUID; + cond->ConditionValue1 = Trinity::Legacy::ConvertLegacyTypeID(Trinity::Legacy::TypeID(cond->ConditionValue1)); + /* fallthrough */ case CONDITION_OBJECT_ENTRY_GUID: { switch (cond->ConditionValue1) @@ -2147,6 +2154,10 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) const } break; } + case CONDITION_TYPE_MASK_LEGACY: + cond->ConditionType = CONDITION_TYPE_MASK; + cond->ConditionValue1 = Trinity::Legacy::ConvertLegacyTypeMask(cond->ConditionValue1); + /* fallthrough */ case CONDITION_TYPE_MASK: { if (!cond->ConditionValue1 || (cond->ConditionValue1 & ~(TYPEMASK_UNIT | TYPEMASK_PLAYER | TYPEMASK_GAMEOBJECT | TYPEMASK_CORPSE))) |