[Server] Replace Player's isMale() and setIsMale() with gender property

For simplicity and clarity.
new-script-api
David Cernat 7 years ago
parent 6f822f54aa
commit 947b3f76be

@ -45,9 +45,8 @@ void Player::Init(LuaState &lua)
"name", sol::property(&Player::getName, &Player::setName),
"setCharGenStages", &Player::setCharGenStages,
"isMale", &Player::isMale,
"setIsMale", &Player::setIsMale,
"level", sol::property(&Player::getLevel, &Player::setLevel),
"gender", sol::property(&Player::getGender, &Player::setGender),
"race", sol::property(&Player::getRace, &Player::setRace),
"head", sol::property(&Player::getHead, &Player::setHead),
"hair", sol::property(&Player::getHair, &Player::setHair),
@ -353,26 +352,26 @@ void Player::message(const std::string &message, bool toAll)
packet->Send(true);
}
bool Player::isMale() const
void Player::setLevel(int level)
{
return npc.isMale();
creatureStats.mLevel = level;
levelChanged = true;
}
void Player::setIsMale(bool male)
int Player::getLevel() const
{
npc.setIsMale(male);
baseInfoChanged = true;
return creatureStats.mLevel;
}
void Player::setLevel(int level)
void Player::setGender(int gender)
{
creatureStats.mLevel = level;
levelChanged = true;
npc.setIsMale(gender);
baseInfoChanged = true;
}
int Player::getLevel() const
int Player::getGender() const
{
return creatureStats.mLevel;
return npc.isMale();
}
void Player::setRace(const std::string &race)

@ -82,8 +82,8 @@ public:
std::string getName();
void setCharGenStages(int currentStage, int endStage);
void message(const std::string &message, bool toAll = false);
bool isMale() const;
void setIsMale(bool male);
void setGender(int gender);
int getGender() const;
void setRace(const std::string &race);
std::string getRace() const;
void setHead(const std::string &head);

Loading…
Cancel
Save