[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:

View file

@ -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?

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "12582"
#define REVISION_NR "12583"
#endif // __REVISION_NR_H__