mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Conditions: Add CONDITION_GENDER = 20
This commit is contained in:
@@ -105,6 +105,12 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
|
||||
condMeets = unit->getRaceMask() & ConditionValue1;
|
||||
break;
|
||||
}
|
||||
case CONDITION_GENDER:
|
||||
{
|
||||
if (Player* player = object->ToPlayer())
|
||||
condMeets = player->getGender() == ConditionValue1;
|
||||
break;
|
||||
}
|
||||
case CONDITION_SKILL:
|
||||
{
|
||||
if (Player* player = object->ToPlayer())
|
||||
@@ -442,6 +448,8 @@ uint32 Condition::GetSearcherTypeMaskForCondition()
|
||||
case CONDITION_SPAWNMASK:
|
||||
mask |= GRID_MAP_TYPE_MASK_ALL;
|
||||
break;
|
||||
case CONDITION_GENDER:
|
||||
mask |= GRID_MAP_TYPE_MASK_PLAYER;
|
||||
default:
|
||||
ASSERT(false && "Condition::GetSearcherTypeMaskForCondition - missing condition handling!");
|
||||
break;
|
||||
@@ -1616,6 +1624,20 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
|
||||
sLog->outError(LOG_FILTER_SQL, "Race condition has useless data in value3 (%u)!", cond->ConditionValue3);
|
||||
break;
|
||||
}
|
||||
case CONDITION_GENDER:
|
||||
{
|
||||
if (!Player::IsValidGender(uint8(cond->ConditionValue1)))
|
||||
{
|
||||
sLog->outError(LOG_FILTER_SQL, "Gender condition has invalid gender (%u), skipped", cond->ConditionValue1);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cond->ConditionValue2)
|
||||
sLog->outError(LOG_FILTER_SQL, "Gender condition has useless data in value2 (%u)!", cond->ConditionValue2);
|
||||
if (cond->ConditionValue3)
|
||||
sLog->outError(LOG_FILTER_SQL, "Gender condition has useless data in value3 (%u)!", cond->ConditionValue3);
|
||||
break;
|
||||
}
|
||||
case CONDITION_MAPID:
|
||||
{
|
||||
MapEntry const* me = sMapStore.LookupEntry(cond->ConditionValue1);
|
||||
|
||||
@@ -53,7 +53,7 @@ enum ConditionTypes
|
||||
CONDITION_ACHIEVEMENT = 17, // achievement_id 0 0 true if achievement is complete
|
||||
CONDITION_TITLE = 18, // title id 0 0 true if player has title
|
||||
CONDITION_SPAWNMASK = 19, // spawnMask 0 0 true if in spawnMask
|
||||
CONDITION_UNUSED_20 = 20, //
|
||||
CONDITION_GENDER = 20, // gender 0 0 true if player's gender is equal to gender
|
||||
CONDITION_UNUSED_21 = 21, //
|
||||
CONDITION_MAPID = 22, // map_id 0 0 true if in map_id
|
||||
CONDITION_AREAID = 23, // area_id 0 0 true if in area_id
|
||||
|
||||
Reference in New Issue
Block a user