From 112d2ad1904051160822d1845d1418cca889c0d5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 14 Mar 2012 03:56:02 +0300 Subject: Add support for other gender. Fix per gender and race items separation. --- src/being.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/being.cpp') diff --git a/src/being.cpp b/src/being.cpp index db8940662..15d93f251 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -2627,6 +2627,35 @@ void Being::updatePercentHP() } } +int Being::genderToInt(Gender sex) +{ + switch (sex) + { + case GENDER_FEMALE: + case GENDER_UNSPECIFIED: + default: + return 0; + case GENDER_MALE: + return 1; + case GENDER_OTHER: + return 3; + } +} + +Gender Being::intToGender(int sex) +{ + switch (sex) + { + case 0: + default: + return GENDER_FEMALE; + case 1: + return GENDER_MALE; + case 3: + return GENDER_OTHER; + } +} + BeingEquipBackend::BeingEquipBackend(Being *being): mBeing(being) { -- cgit v1.2.3-70-g09d2