summaryrefslogtreecommitdiff
path: root/indra/newview/scripts/lua/util.lua
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2024-03-21 20:24:24 +0200
committerMnikolenko Productengine <mnikolenko@productengine.com>2024-03-21 20:24:24 +0200
commit4ffdae72392ba2f081edf8d740b688b95ac4fc65 (patch)
treed65d36378f1b264d7175470dc0ba28d06e86a113 /indra/newview/scripts/lua/util.lua
parent76752d6fc00a2789d96480da2a1e862ffecc812a (diff)
Accept an array for "add_list_item" and change EVENT_LIST type
Diffstat (limited to 'indra/newview/scripts/lua/util.lua')
-rw-r--r--indra/newview/scripts/lua/util.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/indra/newview/scripts/lua/util.lua b/indra/newview/scripts/lua/util.lua
index e3af633ea7..5d6042dfe5 100644
--- a/indra/newview/scripts/lua/util.lua
+++ b/indra/newview/scripts/lua/util.lua
@@ -36,4 +36,14 @@ function util.equal(t1, t2)
return util.empty(temp)
end
+-- check if array-like table contains certain value
+function util.contains(t, v)
+ for _, value in ipairs(t) do
+ if value == v then
+ return true
+ end
+ end
+ return false
+end
+
return util