diff options
| author | Shauren <shauren.trinity@gmail.com> | 2020-05-24 22:34:25 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2020-05-24 22:34:25 +0200 |
| commit | eba31dea27b7fdc4a49c024898ef3a01bcbc7295 (patch) | |
| tree | 4be401cb2969769c92b571e1b8d04555f633693e /src/server/scripts | |
| parent | ebb6f12db811d78a538982cca9b8cc1887fc2527 (diff) | |
Core/Maps: Improvements to terrain swap handling
* Fixed memory leak when unloading grids
* Handle child maps being entered
* Allow chaining more child maps (Draenor -> Tanaan Jungle -> Tanaan Jungle - No Hubs Phase)
Diffstat (limited to 'src/server/scripts')
| -rw-r--r-- | src/server/scripts/Commands/cs_go.cpp | 8 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_misc.cpp | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp index 4b0da78f3eb..bfc3c8956dd 100644 --- a/src/server/scripts/Commands/cs_go.cpp +++ b/src/server/scripts/Commands/cs_go.cpp @@ -248,7 +248,7 @@ public: else player->SaveRecallPosition(); - Map const* map = sMapMgr->CreateBaseMap(mapId); + Map* map = sMapMgr->CreateBaseMap(mapId); float z = std::max(map->GetStaticHeight(PhasingHandler::GetEmptyPhaseShift(), x, y, MAX_HEIGHT), map->GetWaterLevel(PhasingHandler::GetEmptyPhaseShift(), x, y)); player->TeleportTo(mapId, x, y, z, player->GetOrientation()); @@ -370,7 +370,7 @@ public: else player->SaveRecallPosition(); - Map const* map = sMapMgr->CreateBaseMap(mapId); + Map* map = sMapMgr->CreateBaseMap(mapId); z = std::max(map->GetStaticHeight(PhasingHandler::GetEmptyPhaseShift(), x, y, MAX_HEIGHT), map->GetWaterLevel(PhasingHandler::GetEmptyPhaseShift(), x, y)); player->TeleportTo(mapId, x, y, z, 0.0f); @@ -506,7 +506,7 @@ public: AreaTableEntry const* zoneEntry = areaEntry->ParentAreaID ? sAreaTableStore.LookupEntry(areaEntry->ParentAreaID) : areaEntry; ASSERT(zoneEntry); - Map const* map = sMapMgr->CreateBaseMap(zoneEntry->ContinentID); + Map* map = sMapMgr->CreateBaseMap(zoneEntry->ContinentID); if (map->Instanceable()) { @@ -581,7 +581,7 @@ public: handler->SetSentErrorMessage(true); return false; } - Map const* map = sMapMgr->CreateBaseMap(mapId); + Map* map = sMapMgr->CreateBaseMap(mapId); z = std::max(map->GetStaticHeight(PhasingHandler::GetEmptyPhaseShift(), x, y, MAX_HEIGHT), map->GetWaterLevel(PhasingHandler::GetEmptyPhaseShift(), x, y)); } diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 23dbd8e3d1a..23804a75a21 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -260,7 +260,7 @@ public: sDB2Manager.Map2ZoneCoordinates(zoneId, zoneX, zoneY); - Map const* map = object->GetMap(); + Map* map = object->GetMap(); float groundZ = map->GetHeight(object->GetPhaseShift(), object->GetPositionX(), object->GetPositionY(), MAX_HEIGHT); float floorZ = map->GetHeight(object->GetPhaseShift(), object->GetPositionX(), object->GetPositionY(), object->GetPositionZ()); |
