fix PreloadHousingMaps
This commit is contained in:
@@ -674,12 +674,17 @@ void MapManager::PreloadHousingMaps()
|
||||
|
||||
sScriptMgr->OnCreateMap(map);
|
||||
|
||||
// Load every grid so all entities are fully spawned before any player connects.
|
||||
map->LoadAllGrids();
|
||||
// Loading every grid pre-spawns the whole neighborhood, but it sweeps all 64x64 cells
|
||||
// of the map at boot and asks for mmap tiles that neighborhood maps never generate.
|
||||
// Neighborhood grids load on demand like any other map; enable Housing.LoadAllGrids
|
||||
// to restore the old eager behaviour.
|
||||
if (sWorld->getBoolConfig(CONFIG_HOUSING_LOAD_ALL_GRIDS))
|
||||
map->LoadAllGrids();
|
||||
|
||||
++count;
|
||||
TC_LOG_INFO("housing", "MapManager::PreloadHousingMaps: Pre-loaded neighborhood '{}' (map={} instanceId={}) with all cells",
|
||||
neighborhood->GetName(), mapId, instanceId);
|
||||
TC_LOG_INFO("housing", "MapManager::PreloadHousingMaps: Pre-loaded neighborhood '{}' (map={} instanceId={}){}",
|
||||
neighborhood->GetName(), mapId, instanceId,
|
||||
sWorld->getBoolConfig(CONFIG_HOUSING_LOAD_ALL_GRIDS) ? " with all cells" : "");
|
||||
}
|
||||
|
||||
TC_LOG_INFO("server.loading", ">> Pre-loaded {} housing neighborhood maps in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
|
||||
@@ -745,6 +745,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
{ .Name = "Housing.EnableCreateCharterNeighborhood"sv, .DefaultValue = true, .Index = CONFIG_HOUSING_ENABLE_CREATE_CHARTER_NEIGHBORHOOD },
|
||||
{ .Name = "Housing.EnableCreateGuildNeighborhood"sv, .DefaultValue = true, .Index = CONFIG_HOUSING_ENABLE_CREATE_GUILD_NEIGHBORHOOD },
|
||||
{ .Name = "Housing.TutorialsEnabled"sv, .DefaultValue = true, .Index = CONFIG_HOUSING_TUTORIALS_ENABLED },
|
||||
{ .Name = "Housing.LoadAllGrids"sv, .DefaultValue = false, .Index = CONFIG_HOUSING_LOAD_ALL_GRIDS },
|
||||
} };
|
||||
|
||||
static constexpr ConfigOptionLoadDefinitionArray<uint32, INT_CONFIG_VALUE_COUNT> ints =
|
||||
|
||||
@@ -213,6 +213,7 @@ enum WorldBoolConfigs : uint32
|
||||
CONFIG_HOUSING_ENABLE_CREATE_CHARTER_NEIGHBORHOOD,
|
||||
CONFIG_HOUSING_ENABLE_CREATE_GUILD_NEIGHBORHOOD,
|
||||
CONFIG_HOUSING_TUTORIALS_ENABLED,
|
||||
CONFIG_HOUSING_LOAD_ALL_GRIDS,
|
||||
BOOL_CONFIG_VALUE_COUNT
|
||||
};
|
||||
|
||||
|
||||
@@ -5695,6 +5695,16 @@ Housing.EnableCreateGuildNeighborhood = 1
|
||||
|
||||
Housing.TutorialsEnabled = 1
|
||||
|
||||
# Housing.LoadAllGrids
|
||||
# Description: Load every grid of each preloaded neighborhood map at startup, so every
|
||||
# plot and decor object exists before the first player connects. Costs a
|
||||
# full 64x64 cell sweep per neighborhood map (and a lot of mmap lookups
|
||||
# for tiles that neighborhood maps do not ship) and visibly slows startup.
|
||||
# When disabled, neighborhood grids load on demand like any other map.
|
||||
# Default: false
|
||||
|
||||
Housing.LoadAllGrids = 0
|
||||
|
||||
# Housing.MaxHousesPerAccount
|
||||
# Description: Maximum number of houses one battle.net account may own.
|
||||
# Default: 2
|
||||
|
||||
Reference in New Issue
Block a user