1
0
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:
BlueRock (on discord) 2020-08-09 20:58:59 -04:00 committed by GitHub
parent a2205fb543
commit e2b6f6096d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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