Skip to content

Commit

Permalink
https://github.com/pyanodon/pybugreports/issues/336
Browse files Browse the repository at this point in the history
  • Loading branch information
notnotmelon committed Nov 16, 2023
1 parent 33c3b62 commit 1dc2c1c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Date: ???
- Fixed that dingrit mk2,mk3,mk4 module recipes were not outputting any empty cages
- Moved all aerial turbine code to pyAE
- fixed digosaurus being recorded in kill statistics
- fixed crash when mixing oculas and factorissimo 2 (https://github.com/pyanodon/pybugreports/issues/336)
---------------------------------------------------------------------------------------------------
Version: 2.1.9
Date: 2023-9-4
Expand Down
14 changes: 12 additions & 2 deletions scripts/ocula/ocula.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ Oculua.events.on_init = function()
end

function Oculua.set_target(oculua_data, target)
oculua_data.entity.set_command{
local entity = oculua_data.entity
if entity.surface_index ~= target.surface_index then
Oculua.go_home(oculua_data)
return
end
entity.set_command{
type = defines.command.go_to_location,
destination_entity = target,
radius = Oculua.range,
Expand Down Expand Up @@ -232,7 +237,12 @@ end
function Oculua.go_home(oculua_data)
local ipod = oculua_data.ipod
if not ipod or not ipod.valid then Oculua.wander(oculua_data); return end
oculua_data.entity.set_command{
local entity = oculua_data.entity
if not ipod or not ipod.valid or ipod.surface_index ~= entity.surface_index then
Oculua.wander(oculua_data)
return
end
entity.set_command{
type = defines.command.go_to_location,
destination_entity = ipod,
radius = 0.5,
Expand Down

0 comments on commit 1dc2c1c

Please sign in to comment.