From 09499f334b89aad1397b722815bba6e47cc17f62 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Sun, 15 Apr 2018 20:01:13 +0100 Subject: [PATCH] Reapir made cleaner --- Addons/Commands/repair.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Addons/Commands/repair.lua b/Addons/Commands/repair.lua index ba29f90d..1c41900d 100644 --- a/Addons/Commands/repair.lua +++ b/Addons/Commands/repair.lua @@ -32,9 +32,11 @@ commands.add_command('repair', 'Repairs all destoryed and damaged entites in an for y = -range-2, range+2 do if x^2+y^2 < range^2 then for key, entity in pairs(player.surface.find_entities_filtered({area={{x+center.x,y+center.y},{x+center.x+1,y+center.y+1}},type='entity-ghost'})) do - if not disallow[entity.name] then - entity.revive() - else 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() end + if disallow[entity.name] then + 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() + else entity.revive() end end for key, entity in pairs(player.surface.find_entities({{x+center.x,y+center.y},{x+center.x+1,y+center.y+1}})) do if entity.health then entity.health = 10000 end end end