fix: added missing checks for PetIsDeadValue

Hunter under level 10, which are not able to summon their pets defined in the database spammed SELECT id FROM character_pet WHERE owner = {}, since the result of the query was true. Bots under level 10 already have pets in their stables. Also the same thing applied to Bots on mounts, because, while mounted, pets get despawned. This should drastically improve server performance.
This commit is contained in:
Veit F.
2025-06-12 13:32:40 +02:00
parent ec0a092825
commit d4ec519a27

View File

@@ -40,6 +40,11 @@ bool IsDeadValue::Calculate()
bool PetIsDeadValue::Calculate()
{
if ((bot->GetLevel() < 10 && bot->getClass() == CLASS_HUNTER) || bot->IsMounted())
{
return false;
}
if (!bot->GetPet())
{
uint32 ownerid = bot->GetGUID().GetCounter();