From 1ce8d641f4229312c2c3167652daf2bab5acf330 Mon Sep 17 00:00:00 2001 From: Trazom62 Date: Thu, 25 Feb 2010 19:15:35 +0100 Subject: Fix Crash in Unit::GetVehicleCreatureBase. Thanks proof1337. Fixes issue #821. --HG-- branch : trunk --- src/game/Unit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index a1c6a5d272d..e92fcfad94f 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -15213,8 +15213,8 @@ Unit *Unit::GetVehicleBase() const Creature *Unit::GetVehicleCreatureBase() const { Unit *veh = GetVehicleBase(); - if (veh->GetTypeId() == TYPEID_UNIT) - return (Creature*)veh; + if (veh && veh->GetTypeId() == TYPEID_UNIT) + return dynamic_cast(veh); return NULL; } -- cgit v1.2.3