Skip to content

Commit

Permalink
title system: fix title by sex.
Browse files Browse the repository at this point in the history
  • Loading branch information
elsongabriel committed Apr 15, 2024
1 parent e2c3ca7 commit c547af9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/creatures/players/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6180,8 +6180,6 @@ void Player::sendCyclopediaCharacterAchievements(uint16_t secretsUnlocked, std::
}
}

// todo send titles function

uint64_t Player::getMoney() const {
std::vector<std::shared_ptr<Container>> containers;
uint64_t moneyCount = 0;
Expand Down
3 changes: 2 additions & 1 deletion src/server/network/protocol/protocolgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4042,7 +4042,8 @@ void ProtocolGame::sendCyclopediaCharacterTitles() {
std::string messageTitleDesc = "ProtocolGame::sendCyclopediaCharacterTitles - title.description";
for (const auto &title : titles) {
msg.addByte(title.m_id);
msg.addString(player->getSex() == PLAYERSEX_MALE ? title.m_maleName : title.m_femaleName, messageTitleName);
auto titleName = player->getSex() == PLAYERSEX_FEMALE && !title.m_femaleName.empty() ? title.m_femaleName : title.m_maleName;
msg.addString(titleName, messageTitleName);
msg.addString(title.m_description, messageTitleDesc);
msg.addByte(title.m_permanent ? 0x01 : 0x00);
msg.addByte(player->title()->isTitleUnlocked(title.m_id) ? 0x01 : 0x00);
Expand Down

0 comments on commit c547af9

Please sign in to comment.