mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 12:31:41 +09:00
Fixed Existing Lua Check Errors
This commit is contained in:
@@ -11,18 +11,18 @@ local max_time_to_live = 4294967295 -- unit32 max
|
||||
--- Repairs entities on your force around you
|
||||
-- @command repair
|
||||
-- @tparam number range the range to repair stuff in, there is a max limit to this
|
||||
Commands.new_command('repair','Repairs entities on your force around you')
|
||||
:add_param('range',false,'integer-range',1,config.max_range)
|
||||
:register(function(player,range,raw)
|
||||
Commands.new_command('repair', 'Repairs entities on your force around you')
|
||||
:add_param('range', false, 'integer-range', 1,config.max_range)
|
||||
:register(function(player, range)
|
||||
local revive_count = 0
|
||||
local heal_count = 0
|
||||
local range2 = range^2
|
||||
local surface = player.surface
|
||||
local center = player.position
|
||||
local area = {{x=center.x-range,y=center.y-range},{x=center.x+range,y=center.y+range}}
|
||||
local area = {{x=center.x-range, y=center.y-range}, {x=center.x+range, y=center.y+range}}
|
||||
if config.allow_ghost_revive then
|
||||
local ghosts = surface.find_entities_filtered({area=area,type='entity-ghost',force=player.force})
|
||||
for _,ghost in pairs(ghosts) do
|
||||
local ghosts = surface.find_entities_filtered({area=area, type='entity-ghost', force=player.force})
|
||||
for _, ghost in pairs(ghosts) do
|
||||
if ghost.valid then
|
||||
local x = ghost.position.x-center.x
|
||||
local y = ghost.position.y-center.y
|
||||
@@ -36,8 +36,8 @@ Commands.new_command('repair','Repairs entities on your force around you')
|
||||
end
|
||||
end
|
||||
if config.allow_heal_entities then
|
||||
local entities = surface.find_entities_filtered({area=area,force=player.force})
|
||||
for _,entity in pairs(entities) do
|
||||
local entities = surface.find_entities_filtered({area=area, force=player.force})
|
||||
for _, entity in pairs(entities) do
|
||||
if entity.valid then
|
||||
local x = entity.position.x-center.x
|
||||
local y = entity.position.y-center.y
|
||||
@@ -48,5 +48,5 @@ Commands.new_command('repair','Repairs entities on your force around you')
|
||||
end
|
||||
end
|
||||
end
|
||||
return Commands.success{'expcom-repair.result',revive_count,heal_count}
|
||||
return Commands.success{'expcom-repair.result', revive_count, heal_count}
|
||||
end)
|
||||
Reference in New Issue
Block a user