mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-01-08 00:39:30 +02:00
commit
ffda7393b8
@ -86,8 +86,11 @@ local function increment(t, v)
|
||||
t[#t + 1] = (v or 1)
|
||||
end
|
||||
|
||||
-- Removes the first 100 entries of a table
|
||||
local function overflow(t)
|
||||
table.remove(t, 1)
|
||||
for _=1,100,1 do
|
||||
table.remove(t, 1)
|
||||
end
|
||||
end
|
||||
|
||||
local function get_entities(item_name, entities)
|
||||
@ -443,6 +446,13 @@ local function on_entity_died(event)
|
||||
return
|
||||
end
|
||||
end
|
||||
if not this.friendly_fire_history then
|
||||
this.friendly_fire_history = {}
|
||||
end
|
||||
|
||||
if #this.friendly_fire_history > this.limit then
|
||||
overflow(this.friendly_fire_history)
|
||||
end
|
||||
local t = abs(floor((game.tick) / 60))
|
||||
t = FancyTime.short_fancy_time(t)
|
||||
local str = '[' .. t .. '] '
|
||||
|
Loading…
Reference in New Issue
Block a user