Rework smart walk, fix #247

This commit is contained in:
Eduardo Bart
2013-01-26 18:10:30 -02:00
parent 4f8f02acad
commit 2fd3c643c4
12 changed files with 97 additions and 94 deletions

View File

@@ -81,6 +81,20 @@ function table.removevalue(t, value)
end
end
function table.popvalue(value)
local index = nil
for k,v in pairs(t) do
if v == value or not value then
index = k
end
end
if index then
table.remove(t, index)
return true
end
return false
end
function table.compare(t, other)
if #t ~= #other then return false end
for k,v in pairs(t) do