Core/Spells: Allow free casting of player's own spells on vehicle seats with flag VEHICLE_SEAT_FLAG_CAN_ATTACK

This commit is contained in:
Shauren committed 2013-02-27 13:17:20 +01:00
1 parent 480c6cf4dd
commit 9301e31a4e
6 files changed
+104 -49

No files matched your search

+21 -1
View File
@@ -575,6 +575,26 @@ void Vehicle::Dismiss()
GetBase()->ToCreature()->DespawnOrUnsummon();
}
/**
* @fn bool Vehicle::IsVehicleInUse() const
*
* @brief Returns information whether the vehicle is currently used by any unit
*
* @author Shauren
* @date 26-2-2013
*
* @return true if any passenger is boarded on vehicle, false otherwise.
*/
bool Vehicle::IsVehicleInUse() const
{
for (SeatMap::const_iterator itr = Seats.begin(); itr != Seats.end(); ++itr)
if (itr->second.Passenger)
return true;
return false;
}
/**
* @fn void Vehicle::InitMovementInfoForBase()
*
@@ -613,7 +633,7 @@ void Vehicle::InitMovementInfoForBase()
* @return null if passenger not found on vehicle, else the DBC record for the seat.
*/
VehicleSeatEntry const* Vehicle::GetSeatForPassenger(Unit* passenger)
VehicleSeatEntry const* Vehicle::GetSeatForPassenger(Unit const* passenger)
{
SeatMap::iterator itr;
for (itr = Seats.begin(); itr != Seats.end(); ++itr)