1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-14 10:13:13 +02:00

Merge pull request #735 from linaori/stricter-cause-check

Check if the cause is valid and has a force for hydra spawns
This commit is contained in:
Matthew 2019-02-02 16:31:43 -05:00 committed by GitHub
commit d178ba7eae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,7 +72,7 @@ Event.add(defines.events.on_entity_died, function (event)
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 then
elseif spawned and cause and cause.valid and cause.force then
spawned.shooting_target = cause
end
end