Core/Player: add helper methods GetNativeGender/SetNativeGender/SetGender

Port From (https://github.com/TrinityCore/TrinityCore/commit/27886c7f5d6cfc221ea67aab210f96859d725e05)
This commit is contained in:
hondacrx
2021-12-26 19:51:26 -05:00
parent 39dd51370f
commit 6d73a59f63
23 changed files with 69 additions and 64 deletions
+3 -3
View File
@@ -559,7 +559,7 @@ namespace Game
{
Log.outInfo(LogFilter.Player, "Account: {0} (IP: {1}) Create Character: {2} {3}", GetAccountId(), GetRemoteAddress(), createInfo.Name, newChar.GetGUID().ToString());
Global.ScriptMgr.OnPlayerCreate(newChar);
Global.CharacterCacheStorage.AddCharacterCacheEntry(newChar.GetGUID(), GetAccountId(), newChar.GetName(), (byte)newChar.GetNativeSex(), (byte)newChar.GetRace(), (byte)newChar.GetClass(), (byte)newChar.GetLevel(), false);
Global.CharacterCacheStorage.AddCharacterCacheEntry(newChar.GetGUID(), GetAccountId(), newChar.GetName(), (byte)newChar.GetNativeGender(), (byte)newChar.GetRace(), (byte)newChar.GetClass(), (byte)newChar.GetLevel(), false);
SendCharCreate(ResponseCodes.CharCreateSuccess, newChar.GetGUID());
}
@@ -1379,9 +1379,9 @@ namespace Game
_player.ModifyMoney(-cost);
_player.UpdateCriteria(CriteriaType.MoneySpentAtBarberShop, (ulong)cost);
if (_player.GetNativeSex() != (Gender)packet.NewSex)
if (_player.GetNativeGender() != (Gender)packet.NewSex)
{
_player.SetNativeSex((Gender)packet.NewSex);
_player.SetNativeGender((Gender)packet.NewSex);
_player.InitDisplayIds();
_player.RestoreDisplayId(false);
}