[c12583] Implement CONDITION_GENDER

This commit is contained in:
Schmoozerd 2013-05-31 10:27:59 +01:00 committed by Antz
parent e0192deaf6
commit cda8f44cad
3 changed files with 13 additions and 2 deletions

View file

@ -8096,6 +8096,8 @@ bool PlayerCondition::Meets(Player const* player, Map const* map, WorldObject co
}
return false;
}
case CONDITION_GENDER:
return player->getGender() == m_value1;
default:
return false;
}
@ -8508,6 +8510,15 @@ bool PlayerCondition::IsValid(uint16 entry, ConditionType condition, uint32 valu
break;
}
case CONDITION_GENDER:
{
if (value1 >= MAX_GENDER)
{
sLog.outErrorDb("Gender condition (entry %u, type %u) has an invalid value in value1. (Has %u, must be smaller than %u), skipping.", entry, condition, value1, MAX_GENDER);
return false;
}
break;
}
case CONDITION_NONE:
break;
default: