mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-01-18 03:21:47 +02:00
Update hail_hydra.lua
Fixes an infrequent bug in hail_hydra that has existed a long time. Currently Factorio does not allow enemy entitities of type 'turret' to target entities of type 'car' (includes cars and tanks). Doing so logs an error. If this changes in the future then the condition cause.type ~= "car" below can be removed.
This commit is contained in:
parent
a2205fb543
commit
e2b6f6096d
@ -143,15 +143,13 @@ local on_died =
|
||||
local spawned = create_entity({name = hydra_spawn, force = force, position = position})
|
||||
if spawned and spawned.type == 'unit' then
|
||||
spawned.set_command(command)
|
||||
elseif spawned and cause and cause.valid and cause.force and cause.force.valid then
|
||||
if cause.name ~= 'tank' then
|
||||
spawned.shooting_target = cause
|
||||
end
|
||||
elseif spawned and cause and cause.valid and cause.force and cause.type ~= "car" then
|
||||
spawned.shooting_target = cause
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
)
|
||||
|
||||
local function register_event()
|
||||
if not primitives.enabled then
|
||||
|
Loading…
x
Reference in New Issue
Block a user