Skip to content

Commit

Permalink
Unit/Creature: Implement CreatureStaticFlags::DESPAWN_INSTANTLY
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife committed Oct 8, 2023
1 parent f74ec94 commit 7f53efb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/game/Entities/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1457,6 +1457,12 @@ void Unit::JustKilledCreature(Unit* killer, Creature* victim, Player* responsibl

victim->SetKillerGuid(killer ? killer->GetObjectGuid() : ObjectGuid());

if (victim->GetSettings().HasFlag(CreatureStaticFlags::DESPAWN_INSTANTLY))
{
victim->ForcedDespawn(); // no loot or threat list management
return;
}

if (isPet)
return; // Pets might have been unsummoned at this place, do not handle them further!

Expand Down

1 comment on commit 7f53efb

@al3xc1985
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good for cmangos/wotlk-db#920

Please sign in to comment.