Lightorio


Adds a little 'glow' to assembling machines, chem plants and oil refineriers, to make the factory more visible at night. Not intended as an complete replacement for lamps.

Tweaks
1 year, 8 months ago
0.16 - 1.1
28.8K

b [FIXED] Miner rotation crash v1.0

3 years ago

Had a random, but repeatable crash while playing 1.0. Map crashed on miner rotation. Crash occurred on clockwise and counterclockwise rotation.

Error while running event lightorio::on_player_rotated_entity (ID 19)
LuaEntity API call when LuaEntity was invalid.
stack traceback:
lightorio/control.lua:92: in function <lightorio/control.lua:82>
stack traceback:
[C]: in function 'index'
__lightorio
/control.lua:92: in function <lightorio/control.lua:82>

3 years ago

Update: crashed occurred on one specific miner, adjacent miners did not cause crash.

3 years ago

I had the same crash when rotating a miner, and I could replicate it by doing the same thing, but it did not happen when I did some things in a different order

3 years ago

Update: After some investigation, it seems that when you remove the belt that a miner is feeding into, the next time you rotate that miner the mod crashes. I was able to recreate this with several different miners, and with no other mods active.

3 years ago

Update 2: it appears to work with things other than transport belts, such as stone or steel furnaces, or chests. Interestingly, it did not crash when an electric furnace was used. Here is a clip of me recreating it: https://imgur.com/HK9Yea6

3 years ago

I am getting this as well when I rotate miners.

3 years ago
(updated 3 years ago)

Hi All,

Thanks for all the reports. The issue was that the light sources created by this mod are not meant to be minable, and up until now (AFAIK) never have been. For some reason the unminable property is being ignored when another entity is mined from the same tile; in the above example, mining the transport belt is also removing the hidden lamp unexpectedly. This means the background table which silently keeps track of each lamp (to remove the light source again if the parent entity is destroyed or rotated) is now out of sync. SO on rotation, it tries to access a lamp which is no longer there, and then crashes :)

I've added a validation check on rotation (which probably should have been added quite a long time ago) which prevents this. Now, if the lamp is missing, the out of date data will be cleared out and a new lamp created. I suspect this will also fix similar odd behaviors caused by interactions with other mods.

Thanks
Jack

p.s. FWIW it looks like this issue with the hidden lamps being minable only started somewhere in 0.18, 0.17 it doesn't happen. I'll have to scour through change notes to see if this is intentional behaviour, or raise a bug report with the main game devs.

3 years ago

Hi All,

Thanks for all the reports. The issue was that the light sources created by this mod are not meant to be minable, and up until now (AFAIK) never have been. For some reason the unminable property is being ignored when another entity is mined from the same tile; in the above example, mining the transport belt is also removing the hidden lamp unexpectedly. This means the background table which silently keeps track of each lamp (to remove the light source again if the parent entity is destroyed or rotated) is now out of sync. SO on rotation, it tries to access a lamp which is no longer there, and then crashes :)

I've added a validation check on rotation (which probably should have been added quite a long time ago) which prevents this. Now, if the lamp is missing, the out of date data will be cleared out and a new lamp created. I suspect this will also fix similar odd behaviors caused by interactions with other mods.

Thanks
Jack

p.s. FWIW it looks like this issue with the hidden lamps being minable only started somewhere in 0.18 - in 0.17 it doesn't happen. I'll have to scour through change notes to see if this is intentional behaviour, or raise a bug report with the main game devs.

New response