mirror of
https://github.com/edubart/otclient.git
synced 2025-11-30 23:26:51 +01:00
Rework smart walk, fix #247
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user