mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 18:36:31 +01:00
Core/Combat: When entering a vehicle, transfer any current threat to that vehicle. Closes #1340.
(cherry picked from commit 47c7910036)
This commit is contained in:
@@ -888,6 +888,9 @@ bool VehicleJoinEvent::Execute(uint64, uint32)
|
||||
init.SetTransportEnter();
|
||||
Passenger->GetMotionMaster()->LaunchMoveSpline(std::move(init), EVENT_VEHICLE_BOARD, MOTION_PRIORITY_HIGHEST);
|
||||
|
||||
for (auto const& [guid, threatRef] : Passenger->GetThreatManager().GetThreatenedByMeList())
|
||||
threatRef->GetOwner()->GetThreatManager().AddThreat(Target->GetBase(), threatRef->GetThreat(), nullptr, true, true);
|
||||
|
||||
if (Creature* creature = Target->GetBase()->ToCreature())
|
||||
{
|
||||
if (CreatureAI* ai = creature->AI())
|
||||
|
||||
Reference in New Issue
Block a user