Permalink
Browse files

Merge pull request #1418 from TheCycoONE/loop_warn_fix

Fix one iteration loop warnings
  • Loading branch information...
Alberth289346 committed Jun 5, 2018
2 parents 4a509a7 + 0076539 commit 03e261ac94fb587264c6c7dd206612b290ed3221
Showing with 3 additions and 12 deletions.
  1. +0 −3 .luacheckrc
  2. +2 −5 CorsixTH/Lua/entities/object.lua
  3. +1 −4 CorsixTH/Lua/room.lua
View
@@ -139,7 +139,6 @@ add_ignore("CorsixTH/Lua/rooms/operating_theatre.lua", "wait_for_ready")
-- W211: unused variable XYZ
-- W212: unused argument XYZ
-- W231: variable XYZ is never accessed
-- W512: loop is executed at most once
-- W542: empty if branch
add_ignore("CorsixTH/CorsixTH.lua", "121")
add_ignore("CorsixTH/Lua/app.lua", "122")
@@ -182,7 +181,6 @@ add_ignore("CorsixTH/Lua/entities/humanoid.lua", "212")
add_ignore("CorsixTH/Lua/entities/inspector.lua", "212")
add_ignore("CorsixTH/Lua/entities/machine.lua", "212")
add_ignore("CorsixTH/Lua/entities/object.lua", "212")
add_ignore("CorsixTH/Lua/entities/object.lua", "512")
add_ignore("CorsixTH/Lua/entities/patient.lua", "212")
add_ignore("CorsixTH/Lua/entities/patient.lua", "542")
add_ignore("CorsixTH/Lua/entities/staff.lua", "212")
@@ -213,7 +211,6 @@ add_ignore("CorsixTH/Lua/objects/machines/operating_table.lua", "542")
add_ignore("CorsixTH/Lua/persistance.lua", "231") -- th_getupvalue assignments in lua5.2/5.3 code
add_ignore("CorsixTH/Lua/research_department.lua", "212")
add_ignore("CorsixTH/Lua/room.lua", "212")
add_ignore("CorsixTH/Lua/room.lua", "512")
add_ignore("CorsixTH/Lua/rooms/cardiogram.lua", "212")
add_ignore("CorsixTH/Lua/rooms/general_diag.lua", "212")
add_ignore("CorsixTH/Lua/rooms/psych.lua", "212")
@@ -296,18 +296,15 @@ end
function Object:setTile(x, y)
local function coordinatesAreInFootprint(object_footprint, xpos, ypos)
for _, xy in ipairs(object_footprint) do
if(xy[1] == xpos and xy[2] == ypos) then
if xy[1] == xpos and xy[2] == ypos then
return true
end
end
return false
end
local function isEmpty(table)
for _, _ in pairs(table) do
return false
end
return true
return next(table) == nil
end
local function getComplementaryPassableFlag(passable_flag)
View
@@ -258,10 +258,7 @@ function Room:testStaffCriteria(criteria, extra_humanoid)
end
return false
else
for _, _ in pairs(missing) do
return false
end
return true
return next(missing) == nil
end
end

0 comments on commit 03e261a

Please sign in to comment.