aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Grids/ObjectGridLoader.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2013-10-16 18:37:29 +0200
committerShauren <shauren.trinity@gmail.com>2013-10-16 18:37:29 +0200
commitce55647c415b710c6b440d96c2f26ebbc06c1d6e (patch)
tree515af245894c37aa76c590b6e602eb4e398d68be /src/server/game/Grids/ObjectGridLoader.cpp
parent53cc37bceca9ce7de1b9839251ccc809ebf768b6 (diff)
Core/Transports
* Rewritten path generation, now uses splines - timers are a lot more accurate now * Implemented stopping transports * Implemented spawning transports in instances * Implemented spawning gameobjects as transport passengers * Transport passengers are now stored in creature/gameobject table using gameobject_template.data6 from transport's template as map id
Diffstat (limited to 'src/server/game/Grids/ObjectGridLoader.cpp')
-rw-r--r--src/server/game/Grids/ObjectGridLoader.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/server/game/Grids/ObjectGridLoader.cpp b/src/server/game/Grids/ObjectGridLoader.cpp
index 58a5bbbff06..b2ddd6b8a4a 100644
--- a/src/server/game/Grids/ObjectGridLoader.cpp
+++ b/src/server/game/Grids/ObjectGridLoader.cpp
@@ -43,6 +43,20 @@ void ObjectGridEvacuator::Visit(CreatureMapType &m)
}
}
+void ObjectGridEvacuator::Visit(GameObjectMapType &m)
+{
+ // gameobject in unloading grid can have respawn point in another grid
+ // if it will be unloaded then it will not respawn in original grid until unload/load original grid
+ // move to respawn point to prevent this case. For player view in respawn grid this will be normal respawn.
+ for (GameObjectMapType::iterator iter = m.begin(); iter != m.end();)
+ {
+ GameObject* go = iter->GetSource();
+ ++iter;
+
+ go->GetMap()->GameObjectRespawnRelocation(go, true);
+ }
+}
+
// for loading world object at grid loading (Corpses)
/// @todo to implement npc on transport, also need to load npcs at grid loading
class ObjectWorldLoader
@@ -70,7 +84,12 @@ template<class T> void ObjectGridLoader::SetObjectCell(T* /*obj*/, CellCoord con
template<> void ObjectGridLoader::SetObjectCell(Creature* obj, CellCoord const& cellCoord)
{
Cell cell(cellCoord);
+ obj->SetCurrentCell(cell);
+}
+template<> void ObjectGridLoader::SetObjectCell(GameObject* obj, CellCoord const& cellCoord)
+{
+ Cell cell(cellCoord);
obj->SetCurrentCell(cell);
}