Core/SAI: Extended SMART_TARGET_VEHICLE_PASSENGER to allow specifying
seat mask instead of single seat index (can now target all passengers)
This commit is contained in:
1 parent
c23ada7df1
commit
079f2002ac
4 files changed
+11
-8
No files matched your search
@@ -3135,13 +3135,13 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*
|
||||
}
|
||||
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))
|
||||
l->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))
|
||||
l->push_back(u);
|
||||
break;
|
||||
}
|
||||
case SMART_TARGET_POSITION:
|
||||
|
||||
Reference in new issue
Block a user