diff options
author | xinef1 <w.szyszko2@gmail.com> | 2017-01-30 11:10:22 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2018-12-09 14:18:42 +0100 |
commit | fef8e5fe14aa5797b859b2b294386c984ed674b2 (patch) | |
tree | a85488ffb5b6493dcea2086c62f95b736ed0cade /src/server | |
parent | befea2f7a63f6fd244e27b3a000665c7839616e6 (diff) |
Core/Pets: Fixed bug where pets tamed from large npcs had too big combat reach (#18909)
(cherry-picked from 2ecc0c0775927934dcfb60d3ce7664b8273da8a6)
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/game/Entities/Creature/Creature.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 6b9e5bd74ed..e0f03a7717e 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -2848,8 +2848,8 @@ void Creature::SetObjectScale(float scale) if (CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelInfo(GetDisplayId())) { - SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, minfo->bounding_radius * scale); - SetFloatValue(UNIT_FIELD_COMBATREACH, minfo->combat_reach * scale); + SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, (IsPet() ? 1.0f : minfo->bounding_radius) * scale); + SetFloatValue(UNIT_FIELD_COMBATREACH, (IsPet() ? DEFAULT_COMBAT_REACH : minfo->combat_reach) * scale); } } @@ -2859,8 +2859,8 @@ void Creature::SetDisplayId(uint32 modelId) if (CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelInfo(modelId)) { - SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, minfo->bounding_radius * GetObjectScale()); - SetFloatValue(UNIT_FIELD_COMBATREACH, minfo->combat_reach * GetObjectScale()); + SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, (IsPet() ? 1.0f : minfo->bounding_radius) * GetObjectScale()); + SetFloatValue(UNIT_FIELD_COMBATREACH, (IsPet() ? DEFAULT_COMBAT_REACH : minfo->combat_reach) * GetObjectScale()); } } |