narc0tiq / YARM

Yet another variant of the Resource Monitor for Factorio
https://mods.factorio.com/mod/YARM
MIT License
54 stars 42 forks source link

Non-Recoverable Error when expand site button is pressed simultaneously with Q #119

Open ghost opened 5 years ago

ghost commented 5 years ago

To reproduce:

Add patch to monitor. Repeatedly press "expand this site" button while pressing Q. Was able to reproduce multiple times.

Factorio Version: 0.17.52 YARM Version: 0.8.18

From factorio-current.log:

5323.568 Error MainLoop.cpp:1183: Exception at tick 78005: The mod YARM - Resource Monitor caused a non-recoverable error.
Please report this error to the mod author.

Error while running event YARM::on_tick (ID 0)
__YARM__/resmon.lua:1192: attempt to index local 'site' (a nil value)
stack traceback:
    __YARM___/resmon.lua:1192: in function 'process_overlay_for_existing_site'
    __YARM__/resmon.lua:1291: in function 'update_players'
    __YARM__/resmon.lua:1336: in function 'on_tick_internal'
    __YARM__/resmon.lua:1370: in function <__YARM__/resmon.lua:1365
narc0tiq commented 5 years ago

Thank you very much for the report! I've been kept very busy by my new baby this last month, but as time allows I'll come back and look into this.

For my own future reference, I'm guessing some events are happening in the wrong order, so the fix will likely be to trap some more of the exceptional situations and cancel processing when they happen.