need third variable in functions for DismissPet that the spawn list is already locked
else if (dead->IsEntity()) {
// remove all pets for this entity
((Entity*)dead)->DismissPet((NPC*)((Entity*)dead)->GetPet());
((Entity*)dead)->DismissPet((NPC*)((Entity*)dead)->GetCharmedPet());
((Entity*)dead)->DismissPet((NPC*)((Entity*)dead)->GetDeityPet());
((Entity*)dead)->DismissPet((NPC*)((Entity*)dead)->GetCosmeticPet());
}
if (dead->IsPet())
((NPC*)dead)->GetOwner()->DismissPet((NPC*)dead, true);
else if (dead->IsEntity()) {
// remove all pets for this entity
((Entity*)dead)->DismissPet((NPC*)((Entity*)dead)->GetPet(), false, true);
((Entity*)dead)->DismissPet((NPC*)((Entity*)dead)->GetCharmedPet(), false, true);
((Entity*)dead)->DismissPet((NPC*)((Entity*)dead)->GetDeityPet(), false, true);
((Entity*)dead)->DismissPet((NPC*)((Entity*)dead)->GetCosmeticPet(), false, true);
}
Potential fix in...
void Entity::KillSpawn(Spawn* dead, int8 damage_type, int16 kill_blow_type) {
need third variable in functions for DismissPet that the spawn list is already locked
```
else if (dead->IsEntity()) {
// remove all pets for this entity
((Entity*)dead)->DismissPet((NPC*)((Entity*)dead)->GetPet());
((Entity*)dead)->DismissPet((NPC*)((Entity*)dead)->GetCharmedPet());
((Entity*)dead)->DismissPet((NPC*)((Entity*)dead)->GetDeityPet());
((Entity*)dead)->DismissPet((NPC*)((Entity*)dead)->GetCosmeticPet());
}
```
```
if (dead->IsPet())
((NPC*)dead)->GetOwner()->DismissPet((NPC*)dead, true);
else if (dead->IsEntity()) {
// remove all pets for this entity
((Entity*)dead)->DismissPet((NPC*)((Entity*)dead)->GetPet(), false, true);
((Entity*)dead)->DismissPet((NPC*)((Entity*)dead)->GetCharmedPet(), false, true);
((Entity*)dead)->DismissPet((NPC*)((Entity*)dead)->GetDeityPet(), false, true);
((Entity*)dead)->DismissPet((NPC*)((Entity*)dead)->GetCosmeticPet(), false, true);
}
```
Potential fix in...
void Entity::KillSpawn(Spawn* dead, int8 damage_type, int16 kill_blow_type) {
need third variable in functions for DismissPet that the spawn list is already locked