diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 1982c9f64..f783bfff9 100755 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -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: diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index b4735a63f..67b5faffb 100755 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -403,7 +403,7 @@ enum ConditionType CONDITION_SOURCE_AURA = 32, // spell_id effindex (returns true if the source of the condition check has aura of spell_id, effIndex) CONDITION_LAST_WAYPOINT = 33, // waypointId 0 = exact, 1: wp <= waypointId, 2: wp > waypointId Use to check what waypoint was last reached CONDITION_XP_USER = 34, // 0, 1 (0: XP off, 1: XP on) for player 0 - + CONDITION_GENDER = 35, // 0=male, 1=female, 2=none (see enum Gender) }; enum ConditionSource // From where was the condition called? diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index e43e977d3..dc6cc6c62 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 "12582" + #define REVISION_NR "12583" #endif // __REVISION_NR_H__