[1.1.104] 0/0 causing nan set on a circuit signal causes crash to desktop
Posted: Thu Mar 14, 2024 8:14 pm
In short, this causes a crash to desktop on the last call:
Normally x / 0 results in inf, but 0 / 0 is a special case where it results in nan.
Trying to set a circuit signal to inf results in, at least, a useful ingame error. However when one accidentally ends up with 0 / 0, the resulting nan crashes the game to desktop.
Code: Select all
local estimate = 0 / 0
log("estimate: ".. estimate)
local out = {}
table.insert(out, { signal = red_network.signals[1].signal, count = estimate, index = #out + 1 })
struct.internal.get_control_behavior().parameters = out
Trying to set a circuit signal to inf results in, at least, a useful ingame error. However when one accidentally ends up with 0 / 0, the resulting nan crashes the game to desktop.