aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/Unit.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/game/Unit.h b/src/game/Unit.h
index c7e2e838212..523b4c19f7a 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1838,7 +1838,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
bool CreateVehicleKit(uint32 id);
Vehicle *GetVehicleKit()const { return m_vehicleKit; }
Vehicle *GetVehicle() const { return m_vehicle; }
- bool IsOnVehicle(const Unit *unit) const { return m_vehicle == unit->GetVehicleKit(); }
+ bool IsOnVehicle(const Unit *unit) const { return m_vehicle && m_vehicle == unit->GetVehicleKit(); }
Unit *GetVehicleBase() const;
Creature *GetVehicleCreatureBase() const;
float GetTransOffsetX() const { return m_movementInfo.t_x; }