From 187a1916e368fe643de4d6075ff83ee647d5a7d2 Mon Sep 17 00:00:00 2001 From: NoFantasy Date: Sat, 16 Apr 2011 23:40:56 +0200 Subject: [PATCH] [11371] Drop not needed MAX_CONDITION define Signed-off-by: NoFantasy --- src/game/ObjectMgr.cpp | 11 ++++------- src/game/ObjectMgr.h | 2 -- src/shared/revision_nr.h | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 9019537e2..966379989 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -7607,13 +7607,7 @@ bool PlayerCondition::Meets(Player const * player) const // Verification of condition values validity bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 value2) { - if (condition >= MAX_CONDITION) // Wrong condition type - { - sLog.outErrorDb("Condition has bad type of %u, skipped ", condition ); - return false; - } - - switch (condition) + switch(condition) { case CONDITION_AURA: { @@ -7881,6 +7875,9 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val } case CONDITION_NONE: break; + default: + sLog.outErrorDb("Condition has bad type of %u, skipped ", condition); + return false; } return true; } diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index 25aa807ec..14b4001dc 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -357,8 +357,6 @@ enum ConditionType // When player has spell or has item (when defined), condition return false. }; -#define MAX_CONDITION 29 // maximum value in ConditionType enum - struct PlayerCondition { ConditionType condition; // additional condition type diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 64f9c0118..8f2075c0a 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11370" + #define REVISION_NR "11371" #endif // __REVISION_NR_H__