Fix ICTA controller bug

This commit is contained in:
Joachim Stolberg 2022-07-08 20:59:22 +02:00
parent 7082e1ab0d
commit 904d6559d3

View File

@ -153,7 +153,7 @@ techage.icta_register_condition("input", {
return env.input[data.number]
end
local result = function(val)
return techage.compare(val, data.value, data.operand)
return techage.compare(val, tonumber(data.value) or 0, data.operand)
end
return condition, result
end,
@ -196,7 +196,7 @@ techage.icta_register_condition("state", {
return techage.send_single(environ.number, data.number, "state")
end
local result = function(val)
return techage.compare(val, data.value, data.operand)
return techage.compare(val, tonumber(data.value) or 0, data.operand)
end
return condition, result
end,
@ -238,7 +238,7 @@ techage.icta_register_condition("fuel", {
return techage.send_single(environ.number, data.number, "fuel")
end
local result = function(val)
return techage.compare(val, tonumber(data.value), data.operand)
return techage.compare(val, tonumber(data.value) or 0, data.operand)
end
return condition, result
end,
@ -280,7 +280,7 @@ techage.icta_register_condition("load", {
return techage.send_single(environ.number, data.number, "load")
end
local result = function(val)
return techage.compare(val, tonumber(data.value), data.operand)
return techage.compare(val, tonumber(data.value) or 0, data.operand)
end
return condition, result
end,
@ -322,7 +322,7 @@ techage.icta_register_condition("depth", {
return techage.send_single(environ.number, data.number, "depth")
end
local result = function(val)
return techage.compare(val, tonumber(data.value), data.operand)
return techage.compare(val, tonumber(data.value) or 0, data.operand)
end
return condition, result
end,
@ -364,7 +364,7 @@ techage.icta_register_condition("delivered", {
return techage.send_single(environ.number, data.number, "delivered")
end
local result = function(val)
return techage.compare(val, tonumber(data.value), data.operand)
return techage.compare(val, tonumber(data.value) or 0, data.operand)
end
return condition, result
end,
@ -408,7 +408,7 @@ techage.icta_register_condition("chest", {
return techage.send_single(environ.number, data.number, "state")
end
local result = function(val)
return techage.compare(val, data.value, data.operand)
return techage.compare(val, tonumber(data.value) or 0, data.operand)
end
return condition, result
end,
@ -449,7 +449,7 @@ techage.icta_register_condition("signaltower", {
return techage.send_single(environ.number, data.number, "state")
end
local result = function(val)
return techage.compare(val, data.value, data.operand)
return techage.compare(val, tonumber(data.value) or 0, data.operand)
end
return condition, result
end,
@ -919,7 +919,7 @@ techage.icta_register_condition("get_filter", {
return techage.send_single(environ.number, data.number, "port", data.color)
end
local result = function(val)
return techage.compare(val, data.value, data.operand)
return techage.compare(val, tonumber(data.value) or 0, data.operand)
end
return condition, result
end,