1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-10 00:43:27 +02:00
ComfyFactorio/modules/market_friendly_fire_protection.lua

17 lines
425 B
Lua
Raw Normal View History

2019-08-20 22:33:47 +02:00
local event = require 'utils.event'
local function on_entity_damaged(event)
2021-03-24 17:46:00 +02:00
if event.entity.name ~= 'market' then
return false
end
if event.cause then
if event.cause.force.name == 'enemy' then
return false
end
end
event.entity.health = event.entity.health + event.final_damage_amount
return true
2019-08-20 22:33:47 +02:00
end
2021-03-24 17:46:00 +02:00
event.add(defines.events.on_entity_damaged, on_entity_damaged)