Skip to content

Commit

Permalink
Map: Properly pass instance id to dk map
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife committed Aug 18, 2023
1 parent 44f70df commit 411996a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/game/Maps/Map.h
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ class WorldMap : public Map
private:
using Map::GetPersistentState; // hide in subclass for overwrite
public:
WorldMap(uint32 id, time_t expiry) : Map(id, expiry, 0, REGULAR_DIFFICULTY) {}
WorldMap(uint32 id, time_t expiry, uint32 InstanceId) : Map(id, expiry, InstanceId, REGULAR_DIFFICULTY) {}
~WorldMap() {}

// can't be nullptr for loaded map
Expand Down
6 changes: 3 additions & 3 deletions src/game/Maps/MapManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void MapManager::CreateContinents()
uint32 continents[] = { 0, 1, 530, 571};
for (auto id : continents)
{
Map* m = new WorldMap(id, i_gridCleanUpDelay);
Map* m = new WorldMap(id, i_gridCleanUpDelay, 0);
// add map into container
i_maps[MapID(id)] = m;

Expand Down Expand Up @@ -133,9 +133,9 @@ Map* MapManager::CreateMap(uint32 id, const WorldObject* obj)
if (m == nullptr)
{
std::lock_guard<std::mutex> lock(m_lock);
m = new WorldMap(id, i_gridCleanUpDelay);
m = new WorldMap(id, i_gridCleanUpDelay, instanceId);
// add map into container
i_maps[MapID(id)] = m;
i_maps[MapID(id, instanceId)] = m;

// non-instanceable maps always expected have saved state
m->Initialize();
Expand Down

0 comments on commit 411996a

Please sign in to comment.