This commit is contained in:
Manuel Simon Hirsig
2016-03-04 21:45:15 +01:00
parent 24159a0255
commit f1ca8ec46c
5 changed files with 173 additions and 168 deletions
+10 -10
View File
@@ -51,17 +51,17 @@ function Aux.util.inventory_iterator()
end
end
function Aux.util.safe_index(chain)
local target = chain[1]
function public.safe_index(...)
local target = arg[1]
for i=2,getn(chain) do
if not target then
return
end
target = target[chain[i]]
end
for i=2,arg.n do
if not target then
return
end
target = target[arg[i]]
end
return target
return target
end
function Aux_PluralizeIf(word, count)
@@ -69,7 +69,7 @@ function Aux_PluralizeIf(word, count)
if count and count == 1 then
return word
else
return word.."s"
return word..'s'
end
end