Core/Maps: merged a crash fix for spawn group activation

* merged a change to recreate instance maps from orphaned saves
This commit is contained in:
Ovahlord
2018-08-29 22:56:03 +02:00
parent db2e7f1266
commit fcd789128c
2 changed files with 4 additions and 2 deletions

View File

@@ -3313,6 +3313,7 @@ bool Map::SpawnGroupSpawn(uint32 groupId, bool ignoreRespawn, bool force, std::v
return false;
}
SetSpawnGroupActive(groupId, true); // start processing respawns for the group
for (auto& pair : sObjectMgr->GetSpawnDataForGroup(groupId))
{
SpawnData const* data = pair.second;
@@ -3363,7 +3364,6 @@ bool Map::SpawnGroupSpawn(uint32 groupId, bool ignoreRespawn, bool force, std::v
return false;
}
}
SetSpawnGroupActive(groupId, true); // start processing respawns for the group
return true;
}

View File

@@ -153,7 +153,9 @@ Map* MapInstanced::CreateInstanceForPlayer(uint32 mapId, Player* player, uint32
if (loginInstanceId) // if the player has a saved instance id on login, we either use this instance or relocate him out (return null)
{
map = FindInstanceMap(loginInstanceId);
return (map && map->GetId() == GetId()) ? map : nullptr; // is this check necessary? or does MapInstanced only find instances of itself?
if (!map && pSave && pSave->GetInstanceId() == loginInstanceId)
map = CreateInstance(loginInstanceId, pSave, pSave->GetDifficulty());
return map;
}
InstanceGroupBind* groupBind = nullptr;