From a577a6088375e4d66335e566683f3a93434c7bd6 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Thu, 10 May 2018 17:32:35 +0100 Subject: [PATCH] Change name of max_health to max_time_to_live --- Addons/Commands/repair.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Addons/Commands/repair.lua b/Addons/Commands/repair.lua index 9d2a1a6a..654af5f9 100644 --- a/Addons/Commands/repair.lua +++ b/Addons/Commands/repair.lua @@ -29,7 +29,7 @@ commands.add_command('repair', 'Repairs all destoryed and damaged entites in an local center = player and player.position or {x=0,y=0} if not range or max_range and range > max_range then player_return({'commands.invalid-range',0,math.floor(max_range)}) return commands.error end local area = {{center.x-range,center.y-range},{center.x+range,center.y+range}} - local max_health = 2^32 - 1 + local max_time_to_live = 2^32 - 1 local sq_range = range^2 for key, entity in pairs(player.surface.find_entities_filtered({area=area,type='entity-ghost'})) do if entity.force == player.force and (entity.position.x-center.x)^2+(entity.position.y-center.y)^2 < sq_range then @@ -37,7 +37,7 @@ commands.add_command('repair', 'Repairs all destoryed and damaged entites in an player_return('You have repaired: '..entity.name..' this item is not allowed.',defines.text_color.crit,player) Admin.temp_ban(player,'','Attempt To Repair A Banned Item') entity.destroy() - elseif entity.time_to_live ~= max_health then + elseif entity.time_to_live ~= max_time_to_live then entity.revive() end end end