From eaec5f438f40bf7c1ccb664391001aa0acdcee60 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Wed, 10 Apr 2019 20:06:32 +0100 Subject: [PATCH] Fixed invalid compilatron bug --- modules/addons/compilatron.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/addons/compilatron.lua b/modules/addons/compilatron.lua index f7142b3d..f184baf5 100644 --- a/modules/addons/compilatron.lua +++ b/modules/addons/compilatron.lua @@ -20,6 +20,8 @@ Global.register( end ) +local Public = {} + --- This will re-create the speech bubble after it de-spawns called with set_timeout local callback = Token.register( @@ -38,6 +40,9 @@ local callback = --- This will move the messages onto the next message in the loop local function circle_messages() for name, ent in pairs(compilatrons) do + if not ent.valid then + Public.spawn_compilatron(game.players[1].surface,name) + end local current_message = current_messages[name] local msg_number local message @@ -58,8 +63,6 @@ end Event.on_nth_tick(config.message_cycle, circle_messages) -local Public = {} - --- This will add a compilatron to the global and start his message cycle -- @tparam entity LuaEntity the compilatron entity that moves around -- @tparam name string the name of the location that the complitron is at