From db70decbf30c044edf01d653045dd1004c68ac04 Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Tue, 7 Jan 2025 21:54:33 +0900 Subject: [PATCH] . --- exp_legacy/module/modules/addons/compilatron.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exp_legacy/module/modules/addons/compilatron.lua b/exp_legacy/module/modules/addons/compilatron.lua index 9e06ae54..9799c2c0 100644 --- a/exp_legacy/module/modules/addons/compilatron.lua +++ b/exp_legacy/module/modules/addons/compilatron.lua @@ -44,7 +44,7 @@ local speech_bubble_async = local function circle_messages() for name, ent in pairs(Public.compilatrons) do if not ent.valid then - Public.spawn_compilatron(game.players[1].surface, name) + Public.spawn_compilatron(game.players[1].surface or game.surfaces[1], name) end local current_message = Public.current_messages[name] local msg_number @@ -93,8 +93,8 @@ end -- @tparam LuaSurface surface the surface to spawn the compilatron on -- @tparam string location the location tag that is in the config file function Public.spawn_compilatron(surface, location) - local position = locations[location] or { x = 0, y = 0 } - local pos = surface.find_non_colliding_position("behemoth-biter", position, 1.5, 0.5) + local position = locations[location] + local pos = surface.find_non_colliding_position("behemoth-biter", position, 1.5, 0.5) or { x = 0, y = 0 } local compi = surface.create_entity{ name = "behemoth-biter", position = pos, force = game.forces.neutral } Public.add_compilatron(compi, location) end