mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
fixed supervisor incorrectly trying to validate tank defs when tank mode is zero
This commit is contained in:
parent
1eede97c08
commit
4f952eff83
@ -21,7 +21,7 @@ local supervisor = require("supervisor.supervisor")
|
||||
|
||||
local svsessions = require("supervisor.session.svsessions")
|
||||
|
||||
local SUPERVISOR_VERSION = "v1.2.2"
|
||||
local SUPERVISOR_VERSION = "v1.2.3"
|
||||
|
||||
local println = util.println
|
||||
local println_ts = util.println_ts
|
||||
@ -44,16 +44,6 @@ local config = supervisor.config
|
||||
|
||||
local cfv = util.new_validator()
|
||||
|
||||
assert((config.FacilityTankMode == 0) or (config.UnitCount == #config.FacilityTankDefs),
|
||||
"startup> the number of facility tank definitions must be equal to the number of units in facility tank mode")
|
||||
|
||||
for i = 1, config.UnitCount do
|
||||
local def = config.FacilityTankDefs[i]
|
||||
cfv.assert_type_int(def)
|
||||
cfv.assert_range(def, 0, 2)
|
||||
assert(cfv.valid(), "startup> invalid facility tank definition for reactor unit " .. i)
|
||||
end
|
||||
|
||||
cfv.assert_eq(#config.CoolingConfig, config.UnitCount)
|
||||
assert(cfv.valid(), "startup> the number of reactor cooling configurations is different than the number of units")
|
||||
|
||||
@ -69,6 +59,17 @@ for i = 1, config.UnitCount do
|
||||
assert(cfv.valid(), "startup> out-of-range number of boilers and/or turbines provided for reactor unit " .. i)
|
||||
end
|
||||
|
||||
if config.FacilityTankMode > 0 then
|
||||
assert(config.UnitCount == #config.FacilityTankDefs, "startup> the number of facility tank definitions must be equal to the number of units in facility tank mode")
|
||||
|
||||
for i = 1, config.UnitCount do
|
||||
local def = config.FacilityTankDefs[i]
|
||||
cfv.assert_type_int(def)
|
||||
cfv.assert_range(def, 0, 2)
|
||||
assert(cfv.valid(), "startup> invalid facility tank definition for reactor unit " .. i)
|
||||
end
|
||||
end
|
||||
|
||||
----------------------------------------
|
||||
-- log init
|
||||
----------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user