[1.1.104] 0/0 causing nan set on a circuit signal causes crash to desktop

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
Mithaldu
Long Handed Inserter
Long Handed Inserter
Posts: 72
Joined: Sun Mar 13, 2016 5:39 pm
Contact:

[1.1.104] 0/0 causing nan set on a circuit signal causes crash to desktop

Post by Mithaldu »

In short, this causes a crash to desktop on the last call:

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
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.
Attachments
nan_crash.zip
(1.92 MiB) Downloaded 17 times

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.104] 0/0 causing nan set on a circuit signal causes crash to desktop

Post by Rseding91 »

Thanks for the report. This will now give a standard modding error for the next release.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Mithaldu
Long Handed Inserter
Long Handed Inserter
Posts: 72
Joined: Sun Mar 13, 2016 5:39 pm
Contact:

Re: [1.1.104] 0/0 causing nan set on a circuit signal causes crash to desktop

Post by Mithaldu »

that was fast :D

Post Reply

Return to “Resolved Problems and Bugs”