[hrusa] [2.0.16]Lua error on laser_defense menu sim if player dies
Posted: Fri Nov 08, 2024 11:44 pm
The game will throw a Lua error if the player dies on the nauvis_biter_base_laser_defense sim. This can have any number of causes, I've attached a mod which simply removes the shield value from the energy-shield-mk2-equipment and all other menu sims.
The fix is to add a character.valid check in the on_tick event.
The fix is to add a character.valid check in the on_tick event.
Code: Select all
script.on_event(defines.events.on_tick, function()
local k, destination = next(points)
if not k then return end
if not character.valid then return end
Code: Select all
Error while running event level::on_tick (ID 0)
LuaEntity API call when LuaEntity was invalid.
stack traceback:
[C]: in function '__index'
[string " local logo = game.surfaces.nauvis.find_en..."]:72: in function <[string " local logo = game.surfaces.nauvis.find_en..."]:68>