From c7d78b5ff930b433c7f09471e825b79e6d9bee4f Mon Sep 17 00:00:00 2001 From: megamage Date: Fri, 17 Apr 2009 15:08:58 -0500 Subject: *Some work on vehicles. --HG-- branch : trunk --- src/game/Map.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/game/Map.cpp') diff --git a/src/game/Map.cpp b/src/game/Map.cpp index d53c617e374..c6c74a74493 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -35,6 +35,7 @@ #include "ScriptCalls.h" #include "Group.h" #include "MapRefManager.h" +#include "Vehicle.h" #include "MapInstanced.h" #include "InstanceSaveMgr.h" @@ -962,6 +963,17 @@ Map::CreatureRelocation(Creature *creature, float x, float y, float z, float ang creature->Relocate(x, y, z, ang); AddUnitToNotify(creature); } + + if(creature->isVehicle()) + { + for(SeatMap::iterator itr = ((Vehicle*)creature)->m_Seats.begin(); itr != ((Vehicle*)creature)->m_Seats.end(); ++itr) + if(itr->second.passenger) + if(itr->second.passenger->GetTypeId() == TYPEID_PLAYER) + PlayerRelocation((Player*)itr->second.passenger, x, y, z, ang); + else + CreatureRelocation((Creature*)itr->second.passenger, x, y, z, ang); + } + assert(CheckGridIntegrity(creature,true)); } -- cgit v1.2.3