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>