fix(Core/Unit): fixup port of Combat/threat system rewrite (#27347)

Co-authored-by: Treeston <[email protected]>
This commit is contained in:
sogladev
2026-08-27 12:20:46 +02:00
committed by GitHub
co-authored by Treeston
parent 04989c97eb
commit a10ae400e0
+9
View File
@@ -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())
{