Core/Unit: Restore function of HandleKillPlayer after bf107e0581

* also fix build
This commit is contained in:
ModoX
2024-01-01 03:33:17 +01:00
parent bf107e0581
commit 78012dadf2
2 changed files with 5 additions and 1 deletions

View File

@@ -387,6 +387,7 @@ void BattlegroundIC::HandleKillUnit(Creature* unit, Unit* killer)
{
if (Player* killerPlayer = killer->GetCharmerOrOwnerPlayerOrPlayerItself())
killerPlayer->CastSpell(killerPlayer, SPELL_DESTROYED_VEHICLE_ACHIEVEMENT, true);
}
}
void BattlegroundIC::HandleKillPlayer(Player* player, Player* killer)

View File

@@ -10957,7 +10957,10 @@ void Unit::SetMeleeAnimKitId(uint16 animKitId)
if (Battleground* bg = bgMap->GetBG())
{
if (Player* playerVictim = victim->ToPlayer())
bg->HandleKillPlayer(playerVictim, player);
{
if (player)
bg->HandleKillPlayer(playerVictim, player);
}
else
bg->HandleKillUnit(victim->ToCreature(), attacker);
}