aboutsummaryrefslogtreecommitdiff
path: root/src/game/Map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Map.cpp')
-rw-r--r--src/game/Map.cpp12
1 files changed, 12 insertions, 0 deletions
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));
}