diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Conditions/ConditionMgr.cpp | 12 | ||||
-rw-r--r-- | src/server/game/Conditions/ConditionMgr.h | 10 |
2 files changed, 16 insertions, 6 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index b60cb428d3b..7dbe704264e 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -160,19 +160,19 @@ bool Condition::Meets(Player * player, Unit* invoker) { switch (mConditionValue2) { - case 0: + case LVL_COND_EQ: condMeets = player->getLevel() == mConditionValue1; break; - case 1: + case LVL_COND_HIGH: condMeets = player->getLevel() > mConditionValue1; break; - case 2: + case LVL_COND_LOW: condMeets = player->getLevel() < mConditionValue1; break; - case 3: + case LVL_COND_HIGH_EQ: condMeets = player->getLevel() >= mConditionValue1; break; - case 4: + case LVL_COND_LOW_EQ: condMeets = player->getLevel() <= mConditionValue1; break; } @@ -1265,7 +1265,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) } case CONDITION_LEVEL: { - if (cond->mConditionValue2 > 4) + if (cond->mConditionValue2 >= LVL_COND_MAX) { sLog.outErrorDb("Level condition has invalid option (%u), skipped", cond->mConditionValue2); return false; diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index 73aab9a0bac..12ae5b0b1c4 100644 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -60,6 +60,16 @@ enum ConditionType CONDITION_MAX = 28 // MAX }; +enum LevelConditionType +{ + LVL_COND_EQ = 0, + LVL_COND_HIGH = 1, + LVL_COND_LOW = 2, + LVL_COND_HIGH_EQ = 3, + LVL_COND_LOW_EQ = 4, + LVL_COND_MAX = 5, +}; + enum ConditionSourceType { CONDITION_SOURCE_TYPE_NONE = 0,//DONE |