From 3c82b498cc694d9ed04e29079a4c61d68dc7741e Mon Sep 17 00:00:00 2001 From: Kittnz Date: Fri, 30 Oct 2015 23:57:23 +0100 Subject: 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. --- src/server/game/Entities/Unit/Unit.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') 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() -- cgit v1.2.3