1
0
mirror of https://github.com/veden/Rampant.git synced 2025-03-17 20:58:35 +02:00

FACTO-274: Fix library initialization

This commit is contained in:
Aaron Veden 2023-03-26 14:05:49 -07:00
parent a220f38f99
commit d6256337b9
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
4 changed files with 20 additions and 9 deletions

View File

@ -214,7 +214,11 @@ local function hookEvents()
end
end
local function initializeLibraries()
local function initializeLibraries(addProperties)
Upgrade.init(Universe)
if addProperties then
Upgrade.addUniverseProperties()
end
BaseUtils.init(Universe)
Squad.init(Universe)
BaseUtils.init(Universe)
@ -227,6 +231,8 @@ end
local function onLoad()
Universe = global.universe
initializeLibraries()
hookEvents()
end
@ -307,10 +313,8 @@ local function onModSettingsChange(event)
end
local function onConfigChanged()
Upgrade.init(Universe)
game.print("Rampant - Version 3.2.0")
Upgrade.addUniverseProperties()
initializeLibraries()
initializeLibraries(true)
Upgrade.attempt()
onModSettingsChange({setting="rampant--"})

View File

@ -620,8 +620,10 @@ end
function ChunkPropertyUtils.init(universe, mapUtils)
Universe = universe
Position = universe.chunkPropertyUtilsQueries.position
activateMap = mapUtils.activateMap
if universe.chunkPropertyUtilsQueries then
Position = universe.chunkPropertyUtilsQueries.position
end
end
ChunkPropertyUtilsG = ChunkPropertyUtils

View File

@ -639,8 +639,10 @@ end
function MapUtils.init(universe)
Universe = universe
NeighborChunks = universe.mapUtilsQueries.neighbors
MapPosition = universe.mapUtilsQueries.position
if universe.mapUtilsQueries then
NeighborChunks = universe.mapUtilsQueries.neighbors
MapPosition = universe.mapUtilsQueries.position
end
end
MapUtilsG = MapUtils

View File

@ -1124,8 +1124,11 @@ end
function Squad.init(universe)
Universe = universe
Queries = Universe.squadQueries
TargetPosition = Universe.squadQueries.targetPosition
Queries = universe.squadQueries
if Queries then
TargetPosition = Queries.targetPosition
SearchPath = Queries.searchPath
end
end
SquadG = Squad