fix(Core/Pets): Corret Pet size for normal and exotics & bigger pets (#16910)

* fix(Core/Pet)

Pet size fixed

* Update Pet.cpp

* Update Pet.cpp
This commit is contained in:
Webdrian
2023-08-06 02:08:34 +02:00
committed by GitHub
parent e6377c55a9
commit 226408329a
+11 -2
View File
@@ -2492,13 +2492,22 @@ float Pet::GetNativeObjectScale() const
scale = creatureFamily->minScale + float(GetLevel() - creatureFamily->minScaleLevel) / creatureFamily->maxScaleLevel * (creatureFamily->maxScale - creatureFamily->minScale); scale = creatureFamily->minScale + float(GetLevel() - creatureFamily->minScaleLevel) / creatureFamily->maxScaleLevel * (creatureFamily->maxScale - creatureFamily->minScale);
if (CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.LookupEntry(GetNativeDisplayId())) if (CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.LookupEntry(GetNativeDisplayId()))
{
if (displayInfo->scale > 1.f && GetCreatureTemplate()->IsExotic()) if (displayInfo->scale > 1.f && GetCreatureTemplate()->IsExotic())
{
// Exotic pets have a scale of 1
scale = 1.0f;
}
else
{
scale *= displayInfo->scale; scale *= displayInfo->scale;
}
}
return scale; return scale;
} }
// Fallback value if the conditions are not met
return Guardian::GetNativeObjectScale(); return 1.0f;
} }
std::string Pet::GenerateActionBarData() const std::string Pet::GenerateActionBarData() const