Core/Conditions: Make CONDITION_CLASS and CONDITION_RACE use a mask, this will reduce the amount of conditions needed

Signed-off-by: Subv <s.v.h21@hotmail.com>
This commit is contained in:
Subv2112
2012-01-28 12:25:44 -05:00
parent eeb35df766
commit ff81a2455b

View File

@@ -73,10 +73,10 @@ bool Condition::Meets(Player* player, Unit* invoker)
condMeets = player->GetTeam() == mConditionValue1;
break;
case CONDITION_CLASS:
condMeets = player->getClass() == mConditionValue1;
condMeets = player->getClassMask() & mConditionValue1;
break;
case CONDITION_RACE:
condMeets = player->getRace() == mConditionValue1;
condMeets = player->getRaceMask() & mConditionValue1;
break;
case CONDITION_SKILL:
condMeets = player->HasSkill(mConditionValue1) && player->GetBaseSkillValue(mConditionValue1) >= mConditionValue2;