1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-16 02:47:48 +02:00

Artillery damage fix

Changes:
- Fixed an issue where if kraken spit hit artillery-turret, it would deal damage to turret, and not to its virtual health.
This commit is contained in:
Piratux 2023-02-21 12:50:14 +02:00
parent 1c088d64b7
commit 83f85f7f4f

View File

@ -263,11 +263,7 @@ end
local function damage_to_artillery(event)
local memory = Memory.get_crew_memory()
if not event.cause then return end
if not event.cause.valid then return end
if not event.cause.name then return end
if Utils.contains(CoreData.enemy_units, event.cause.name) then
if event.cause and event.cause.valid and event.cause.name and Utils.contains(CoreData.enemy_units, event.cause.name) then
if event.cause.force.name ~= memory.enemy_force_name then return end
-- play alert sound for all crew members