*Improvements in map managing.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-08-01 00:20:32 +02:00
parent 0db1fd6c26
commit 1d96091d2a
24 changed files with 276 additions and 305 deletions
+6 -2
View File
@@ -106,7 +106,7 @@ void MapManager::LoadTransports()
m_TransportsByMap[*i].insert(t);
//If we someday decide to use the grid to track transports, here:
t->SetMap(MapManager::Instance().CreateMap(mapid, t));
t->SetMap(MapManager::Instance().CreateMap(mapid, t, 0));
//t->GetMap()->Add<GameObject>((GameObject *)t);
++count;
@@ -459,8 +459,12 @@ void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
//we need to create and save new Map object with 'newMapid' because if not done -> lead to invalid Map object reference...
//player far teleport would try to create same instance, but we need it NOW for transport...
//correct me if I'm wrong O.o
Map * newMap = MapManager::Instance().CreateMap(newMapid, this);
//yes, you're right
ResetMap();
Map * newMap = MapManager::Instance().CreateMap(newMapid, this, 0);
SetMap(newMap);
assert (GetMap());
if(oldMap != newMap)
{