This commit is contained in:
2025-01-07 20:15:03 +09:00
parent 664c9e67c0
commit a38708c203

View File

@@ -44,7 +44,7 @@ local speech_bubble_async =
local function circle_messages() local function circle_messages()
for name, ent in pairs(Public.compilatrons) do for name, ent in pairs(Public.compilatrons) do
if not ent.valid then if not ent.valid then
Public.spawn_compilatron(game.players[1].surface or game.surfaces[1], name) Public.spawn_compilatron(game.players[1].surface, name)
end end
local current_message = Public.current_messages[name] local current_message = Public.current_messages[name]
local msg_number local msg_number
@@ -93,7 +93,7 @@ end
-- @tparam LuaSurface surface the surface to spawn the compilatron on -- @tparam LuaSurface surface the surface to spawn the compilatron on
-- @tparam string location the location tag that is in the config file -- @tparam string location the location tag that is in the config file
function Public.spawn_compilatron(surface, location) function Public.spawn_compilatron(surface, location)
local position = locations[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 pos = surface.find_non_colliding_position("behemoth-biter", position, 1.5, 0.5)
local compi = surface.create_entity{ name = "behemoth-biter", position = pos, force = game.forces.neutral } local compi = surface.create_entity{ name = "behemoth-biter", position = pos, force = game.forces.neutral }
Public.add_compilatron(compi, location) Public.add_compilatron(compi, location)