Awesome sink

by Quezler

Feed items inside and get a higher quality item every X items without random chance.

Content
6 months ago
2.0
2.93K
Factorio: Space Age Icon Space Age Mod
Mining Manufacturing Cheats

g Edge case bug

8 months ago

There seems to be an edge case bug. I can't really replicate the circumstances behind the bug, though it happened to me twice in a row, resulting in lost progress.

As I found it, the bug is in control.lua, line 321, inside the function Handler.handle_signal(). The local variable payout receives a floored value of a count divided by one thousand- while reasonable to assume that this would never return a negative value, my crashes revolved around payout having a value of -1. Since it bypassed the "payout == 0" check, the game would try to insert -1 items on line 333 and crash.

I resolved this issue by modifying line 321 to have a "<=" instead of an "==". There has not been an issue on my end since.

8 months ago

0,o how does it even become a negative value, did you chance a config value halfway through or something? its hard to imagine it would break just like this

8 months ago

I don't think I changed config values midway- this was quite a ways into the save I was playing and I hadn't touched those configs in a while. I do have a large number of mods, so maybe something got a bit funky in there. I am running a mod that adds a few levels of quality (and thus added new amounts of quality to interact with the awesome sink), so maybe something got weird in there? Who knows, I'm working with edge cases on edge cases.

I just thought I'd let you know what I found out and did. Hope it helps in some way.

8 months ago

its still a mystery as to how exactly this can happen, perhaps a sink getting updated in adjacent ticks whilst circuit signals are propogating, either way i've added a below nil check now

New response