mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-21 12:47:07 +00:00
fix(Core/Pets): Correct Pet size for bigger pets 2 (#18867)
* scale displayInfo, cap scale to maxScale * prevent scaling with displayInfo if scale is already increasing the size
This commit is contained in:
@@ -2499,11 +2499,6 @@ float Pet::GetNativeObjectScale() const
|
||||
{
|
||||
uint8 ctFamily = GetCreatureTemplate()->family;
|
||||
|
||||
// hackfix: Edge case where DBC scale values for DEVILSAUR pets make them too small.
|
||||
// Therefore we take data from spirit beast instead.
|
||||
if (ctFamily && ctFamily == CREATURE_FAMILY_DEVILSAUR)
|
||||
ctFamily = CREATURE_FAMILY_SPIRIT_BEAST;
|
||||
|
||||
CreatureFamilyEntry const* creatureFamily = sCreatureFamilyStore.LookupEntry(ctFamily);
|
||||
if (creatureFamily && creatureFamily->minScale > 0.0f && getPetType() & HUNTER_PET)
|
||||
{
|
||||
@@ -2520,6 +2515,13 @@ float Pet::GetNativeObjectScale() const
|
||||
|
||||
float scale = (creatureFamily->maxScale - creatureFamily->minScale) * scaleMod + creatureFamily->minScale;
|
||||
|
||||
scale = std::min(scale, creatureFamily->maxScale);
|
||||
|
||||
if (CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.LookupEntry(GetNativeDisplayId()))
|
||||
{
|
||||
if (scale < 1.f && displayInfo->scale > 1.f)
|
||||
scale *= displayInfo->scale;
|
||||
}
|
||||
return scale;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user