From ce146be9869cb10665811f4716bae758357634a2 Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Tue, 7 Jan 2025 23:01:21 +0900 Subject: [PATCH] . --- exp_legacy/module/modules/addons/compilatron.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/exp_legacy/module/modules/addons/compilatron.lua b/exp_legacy/module/modules/addons/compilatron.lua index 9799c2c0..c72020fa 100644 --- a/exp_legacy/module/modules/addons/compilatron.lua +++ b/exp_legacy/module/modules/addons/compilatron.lua @@ -94,9 +94,11 @@ end -- @tparam string location the location tag that is in the config file function Public.spawn_compilatron(surface, location) 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) + local pos = surface.find_non_colliding_position("behemoth-biter", position, 1.5, 0.5) + if pos then + local compi = surface.create_entity{ name = "behemoth-biter", position = pos, force = game.forces.neutral } + Public.add_compilatron(compi, location) + end end -- When the first player is created this will create all compilatrons that are resisted in the config