Core/Player: add helper methods GetNativeGender/SetNativeGender/SetGender (#23520)

* Core/Player: add helper methods GetNativeGender/SetNativeGender/SetGender and fix some cases, where we should get player gender, instead of modified by display gender

* fix merge

* Add virtual methods for Unit class

(cherry picked from commit b47bb59e2a3e42aff3793517ef94f51678b54905)
This commit is contained in:
ForesterDev
2021-12-13 00:42:20 +01:00
committed by Shauren
parent 4e6c59dca7
commit 27886c7f5d
24 changed files with 78 additions and 74 deletions
+3 -3
View File
@@ -415,7 +415,7 @@ class spell_gen_aura_service_uniform : public AuraScript
Unit* target = GetTarget();
if (target->GetTypeId() == TYPEID_PLAYER)
{
if (target->GetGender() == GENDER_MALE)
if (target->GetNativeGender() == GENDER_MALE)
target->SetDisplayId(MODEL_GOBLIN_MALE);
else
target->SetDisplayId(MODEL_GOBLIN_FEMALE);
@@ -1154,7 +1154,7 @@ class spell_gen_dalaran_disguise : public SpellScriptLoader
{
if (Player* player = GetHitPlayer())
{
uint8 gender = player->GetGender();
uint8 gender = player->GetNativeGender();
uint32 spellId = GetSpellInfo()->Id;
@@ -2382,7 +2382,7 @@ class spell_gen_orc_disguise : public SpellScript
Unit* caster = GetCaster();
if (Player* target = GetHitPlayer())
{
uint8 gender = target->GetGender();
uint8 gender = target->GetNativeGender();
if (!gender)
caster->CastSpell(target, SPELL_ORC_DISGUISE_MALE, true);
else