Core/Vehicles: Implemented vehicle seat flag that makes passengers unselectable and dropped redundant UNIT_STATE_ONVEHICLE (it is only checked in the same places as unselectable unit flag)

This commit is contained in:
Shauren
2013-06-29 15:20:15 +02:00
parent 44c844d6fd
commit 13208ff257
9 changed files with 53 additions and 36 deletions

View File

@@ -467,10 +467,6 @@ class npc_bone_spike : public CreatureScript
init.DisableTransportPathTransformations();
init.MoveTo(-0.02206125f, -0.02132235f, 5.514783f, false);
init.Launch();
/// @WORKAROUND - Clear ON VEHICLE state to allow healing (Invalid target errors)
/// Current rule for applying this state is questionable (seatFlags & VEHICLE_SEAT_FLAG_ALLOW_TURNING ???)
passenger->ClearUnitState(UNIT_STATE_ONVEHICLE);
}
void UpdateAI(uint32 diff)

View File

@@ -1632,7 +1632,7 @@ class FlameLeviathanPursuedTargetSelector
//! Vehicle must be in use by player
bool playerFound = false;
for (SeatMap::const_iterator itr = vehicle->Seats.begin(); itr != vehicle->Seats.end() && !playerFound; ++itr)
if (IS_PLAYER_GUID(itr->second.Passenger))
if (IS_PLAYER_GUID(itr->second.Passenger.Guid))
playerFound = true;
return !playerFound;
@@ -1690,9 +1690,9 @@ class spell_pursue : public SpellScriptLoader
for (SeatMap::const_iterator itr = caster->GetVehicleKit()->Seats.begin(); itr != caster->GetVehicleKit()->Seats.end(); ++itr)
{
if (IS_PLAYER_GUID(itr->second.Passenger))
if (IS_PLAYER_GUID(itr->second.Passenger.Guid))
{
caster->AI()->Talk(EMOTE_PURSUE, itr->second.Passenger);
caster->AI()->Talk(EMOTE_PURSUE, itr->second.Passenger.Guid);
return;
}
}