fix input validation
This commit is contained in:
parent
478d8902b1
commit
01a38ee6fc
@ -265,17 +265,17 @@ local function updateReactorInfo()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Check for zero max values (would cause division by zero)
|
-- -- Check for zero max values (would cause division by zero)
|
||||||
-- Only flag as error if reactor is not offline (these are expected to be 0 when cold)
|
-- -- Only flag as error if reactor is not offline (these are expected to be 0 when cold)
|
||||||
local isOffline = reactorInfo.status == "cold" or reactorInfo.status == "invalid"
|
-- local isOffline = reactorInfo.status == "cold" or reactorInfo.status == "invalid"
|
||||||
if not isOffline then
|
-- if not isOffline then
|
||||||
if reactorInfo.maxFieldStrength ~= nil and reactorInfo.maxFieldStrength <= 0 then
|
-- if reactorInfo.maxFieldStrength ~= nil and reactorInfo.maxFieldStrength <= 0 then
|
||||||
table.insert(fieldErrors, "maxFieldStrength <= 0")
|
-- table.insert(fieldErrors, "maxFieldStrength <= 0")
|
||||||
end
|
-- end
|
||||||
if reactorInfo.maxEnergySaturation ~= nil and reactorInfo.maxEnergySaturation <= 0 then
|
-- if reactorInfo.maxEnergySaturation ~= nil and reactorInfo.maxEnergySaturation <= 0 then
|
||||||
table.insert(fieldErrors, "maxEnergySaturation <= 0")
|
-- table.insert(fieldErrors, "maxEnergySaturation <= 0")
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
|
|
||||||
-- Set error message if we have field errors
|
-- Set error message if we have field errors
|
||||||
if #fieldErrors > 0 then
|
if #fieldErrors > 0 then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user