aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKittnz <frederik156@hotmail.com>2015-10-30 23:57:23 +0100
committerKittnz <frederik156@hotmail.com>2015-10-30 23:57:23 +0100
commit3c82b498cc694d9ed04e29079a4c61d68dc7741e (patch)
treece04144a34ef02528d826301f79db2af80cbf06a
parent144c545e36d6c8c7ade2e40a1065994b5cb75aad (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.
-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 78e65da9758..49c99dd035b 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -14652,6 +14652,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, 2, minfo->gender);
}
void Unit::RestoreDisplayId()