Skip to content

Commit

Permalink
Compilatron Position Check (#348)
Browse files Browse the repository at this point in the history
* Update compilatron.lua

* Update compilatron.lua

* Update compilatron.lua
  • Loading branch information
PHIDIAS0303 authored Jan 8, 2025
1 parent 47b57a9 commit 2e67434
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions exp_legacy/module/modules/addons/compilatron.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ end
function Public.spawn_compilatron(surface, location)
local position = locations[location]
local pos = surface.find_non_colliding_position("small-biter", position, 1.5, 0.5)
local compi = surface.create_entity{ name = "small-biter", position = pos, force = game.forces.neutral }
Public.add_compilatron(compi, location)
if pos then
local compi = surface.create_entity{ name = "small-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
Expand Down

0 comments on commit 2e67434

Please sign in to comment.