Currently testing a local version that uses some extra nil checks wrapped around those lines where the index is used:
control.lua:329
if global.immuneUntil[entity.unit_number] ~= nil then
global.immuneUntil[entity.unit_number] = event.tick+60
end
functions.lua:182
--Take no damage if immune.
if global.immuneUntil[event.entity.unit_number] ~= nil then
if global.immuneUntil[event.entity.unit_number] and global.immuneUntil[event.entity.unit_number] > event.tick then
event.entity.health = event.entity.health + event.final_damage_amount
return
elseif global.immuneUntil[event.entity.unit_number] and global.immuneUntil[event.entity.unit_number] <= event.tick then
global.immuneUntil[event.entity.unit_number] = nil
end
end
formatting is bad here so https://pastebin.com/Qc1w3Ry7