fix: refactored query, pet should only check death state of his current pet

The old query also fetched all pets out of his stable, which is not needed, since we are looking for slot 0 (active pet)
This commit is contained in:
Veit F.
2025-06-12 13:41:17 +02:00
parent d4ec519a27
commit 5a6182f977

View File

@@ -48,7 +48,7 @@ bool PetIsDeadValue::Calculate()
if (!bot->GetPet())
{
uint32 ownerid = bot->GetGUID().GetCounter();
QueryResult result = CharacterDatabase.Query("SELECT id FROM character_pet WHERE owner = {}", ownerid);
QueryResult result = CharacterDatabase.Query("SELECT id FROM character_pet WHERE owner = {} and slot = 0", ownerid);
if (!result)
return false;