aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKittnz <frederik156@hotmail.com>2015-10-31 00:03:38 +0100
committerMitchesD <majklprofik@seznam.cz>2015-11-06 12:52:41 +0100
commit24bad7fd20e4673ca9b5a0996d877a70dbd6588e (patch)
treed1b6c9b607689cf99b626295570bffad856893cd /src
parentdd58e56f840bb5e0a3b9c4a9bef0d59edba123a3 (diff)
Core/Player: Set correct Gender by Modelid
An example: You are a blood elf female, you use [Iron Boot Flask], you turn into a male dwarf, you use [Orb of the Sin'dorei] and it will turn you into a blood elf male. This is the correct behavior like retail. (cherry picked from commit 3c82b498cc694d9ed04e29079a4c61d68dc7741e) (cherry picked from commit 16f9d4ceebe9c4688214df2643fd74c1932e901d)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index ee1d68c7fe6..c15fe26f60e 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -12778,6 +12778,9 @@ bool Unit::IsPolymorphed() const
void Unit::SetDisplayId(uint32 modelId)
{
SetUInt32Value(UNIT_FIELD_DISPLAYID, modelId);
+ // Set Gender by modelId
+ if (CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelInfo(modelId))
+ SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER, minfo->gender);
}
void Unit::RestoreDisplayId()