From a10ae400e0309b464f3ae482a395389040c6b2a4 Mon Sep 17 00:00:00 2001 From: sogladev Date: Thu, 27 Aug 2026 12:20:46 +0200 Subject: [PATCH] fix(Core/Unit): fixup port of Combat/threat system rewrite (#27347) Co-authored-by: Treeston --- src/server/game/Combat/ThreatManager.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index 07e02ae0f5..89ba4dff5f 100644 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -400,6 +400,15 @@ void ThreatManager::AddThreat(Unit* target, float amount, SpellInfo const* spell return; } + // while riding a vehicle, all threat goes to the vehicle, not the pilot + if (Unit* vehicle = target->GetVehicleBase()) + { + AddThreat(vehicle, amount, spell, ignoreModifiers, ignoreRedirects); + if (target->HasUnitTypeMask(UNIT_MASK_ACCESSORY)) // accessories are fully treated as components of the parent and cannot have threat + return; + amount = 0.0f; + } + // if we cannot actually have a threat list, we instead just set combat state and avoid creating threat refs altogether if (!CanHaveThreatList()) {