diff options
| author | Subv <s.v.h21@hotmail.com> | 2012-11-26 14:34:23 -0500 |
|---|---|---|
| committer | Subv <s.v.h21@hotmail.com> | 2012-11-26 14:35:28 -0500 |
| commit | bdbafc018414f9831d045a03cf8cefe1c8e9b6f6 (patch) | |
| tree | 18007f845b525790958763c471bed0674f86a290 /src/server/game/Conditions/ConditionMgr.cpp | |
| parent | ad6b5fb419f8fc940e9ac8f3257c7d629ad53f88 (diff) | |
Core/Conditions: Add CONDITION_GENDER = 20
Diffstat (limited to 'src/server/game/Conditions/ConditionMgr.cpp')
| -rwxr-xr-x | src/server/game/Conditions/ConditionMgr.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 029272b3841..dbde48bd257 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -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); |
