aboutsummaryrefslogtreecommitdiff
path: root/src/game/Vehicle.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Vehicle.h')
-rw-r--r--src/game/Vehicle.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/game/Vehicle.h b/src/game/Vehicle.h
index c01ca027670..a4dffa9ea03 100644
--- a/src/game/Vehicle.h
+++ b/src/game/Vehicle.h
@@ -33,7 +33,7 @@ struct VehicleSeat
Unit* passenger;
};
-typedef std::map<uint32, VehicleSeat> SeatMap;
+typedef std::map<int8, VehicleSeat> SeatMap;
class Vehicle : public Creature
{
@@ -52,7 +52,13 @@ class Vehicle : public Creature
VehicleEntry const *GetVehicleInfo() { return m_vehicleInfo; }
void SetVehicleId(uint32 vehicleid);
- void AddPassenger(Unit *passenger);
+ bool HasEmptySeat(int8 seatNum) const
+ {
+ SeatMap::const_iterator seat = m_Seats.find(seatNum);
+ if(seat == m_Seats.end()) return false;
+ return !seat->second.passenger;
+ }
+ bool AddPassenger(Unit *passenger, int8 seatNum = -1);
void RemovePassenger(Unit *passenger);
void Dismiss();
@@ -62,6 +68,8 @@ class Vehicle : public Creature
protected:
VehicleEntry const *m_vehicleInfo;
+ void RemoveAllPassengers();
+
private:
void SaveToDB(uint32, uint8) // overwrited of Creature::SaveToDB - don't must be called
{