Page 1 of 1

[1.1.53] Crash changing laser turret energy source to lamp.energy_source

Posted: Wed Feb 09, 2022 1:09 pm
by delaporte
Got a crash when changing the energy_source of a laser turret to a lamps energy source. I don't really expect it to work however it does not throw an error during the data stage, instead it crashes when powering a laser turret.

minimum code to reproduce the crash:

Code: Select all

--data.lua
local lamp = data.raw["lamp"]["small-lamp"]
data.raw["electric-turret"]["laser-turret"].energy_source = lamp.energy_source

Re: [1.1.53] Crash changing laser turret energy source to lamp.energy_source

Posted: Thu Feb 10, 2022 7:16 pm
by Rseding91
Thanks for the report. I've changed it for the next release so setting electric priority on non-lamps to 'lamp' will result in an error at startup. The logic internally only works with actual lamp entities so that's the only fix.