Skip to content

Commit

Permalink
Core/Unit: Restore function of HandleKillPlayer after bf107e0
Browse files Browse the repository at this point in the history
* also fix build
  • Loading branch information
mdX7 committed Jan 1, 2024
1 parent bf107e0 commit 78012da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion src/server/game/Entities/Unit/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 78012da

Please sign in to comment.