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:
parent
a220f38f99
commit
d6256337b9
12
control.lua
12
control.lua
@ -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--"})
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user