From aca2d26bc5060808b22bb268e3a04375a1ba6d18 Mon Sep 17 00:00:00 2001 From: silverice Date: Thu, 18 Mar 2010 20:21:42 +0200 Subject: [PATCH] remove unused player's class member,cleanup --HG-- branch : trunk --- src/game/Player.h | 1 - src/game/Unit.cpp | 7 ++++--- src/game/Unit.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/game/Player.h b/src/game/Player.h index 13cda2117c..3f328d4503 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -2578,7 +2578,6 @@ class Player : public Unit, public GridObject MapReference m_mapRef; void UpdateCharmedAI(); - UnitAI *i_AI; uint32 m_lastFallTime; float m_lastFallZ; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index c11bff030c..1b7813d6bb 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -15287,9 +15287,10 @@ Unit *Unit::GetVehicleBase() const Creature *Unit::GetVehicleCreatureBase() const { - Unit *veh = GetVehicleBase(); - if (veh && veh->GetTypeId() == TYPEID_UNIT) - return dynamic_cast(veh); + if( Unit *veh = GetVehicleBase()) + if( Creature *c = veh->ToCreature()) + return c; + return NULL; } diff --git a/src/game/Unit.h b/src/game/Unit.h index 0bdb3e573e..5e40703fd7 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1919,7 +1919,7 @@ class Unit : public WorldObject void RemoveVehicleKit(); Vehicle *GetVehicleKit()const { return m_vehicleKit; } Vehicle *GetVehicle() const { return m_vehicle; } - bool IsOnVehicle(const Unit *unit) const { return m_vehicle && m_vehicle == unit->GetVehicleKit(); } + bool IsOnVehicle(const Unit *vehicle) const { return m_vehicle && m_vehicle == vehicle->GetVehicleKit(); } Unit *GetVehicleBase() const; Creature *GetVehicleCreatureBase() const; float GetTransOffsetX() const { return m_movementInfo.t_x; }