mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-13 11:43:18 -04:00
Core/SAI: Extended SMART_TARGET_VEHICLE_PASSENGER to allow specifying seat mask instead of single seat index (can now target all passengers) (#21245)
(cherry picked from commit 891bca934e)
This commit is contained in:
@@ -2851,13 +2851,13 @@ void SmartScript::GetTargets(ObjectVector& targets, SmartScriptHolder const& e,
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SMART_TARGET_VEHICLE_ACCESSORY:
|
||||
case SMART_TARGET_VEHICLE_PASSENGER:
|
||||
{
|
||||
if (me && me->IsVehicle())
|
||||
{
|
||||
if (Unit* target = me->GetVehicleKit()->GetPassenger(e.target.vehicle.seat))
|
||||
targets.push_back(target);
|
||||
}
|
||||
for (auto seatItr = me->GetVehicleKit()->Seats.begin(); seatItr != me->GetVehicleKit()->Seats.end(); ++seatItr)
|
||||
if (!e.target.vehicle.seatMask || (e.target.vehicle.seatMask & (1 << seatItr->first)))
|
||||
if (Unit* u = ObjectAccessor::GetUnit(*me, seatItr->second.Passenger.Guid))
|
||||
targets.push_back(u);
|
||||
break;
|
||||
}
|
||||
case SMART_TARGET_POSITION:
|
||||
|
||||
Reference in New Issue
Block a user