From 341cd7aa6ea8667314583a1e05928743aa315765 Mon Sep 17 00:00:00 2001 From: tommy aka doge <59783653+dowoge@users.noreply.github.com> Date: Sat, 10 Sep 2022 22:00:49 -0400 Subject: [PATCH] add support for map id --- src/modules/commands/maps_init.lua | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/modules/commands/maps_init.lua b/src/modules/commands/maps_init.lua index bacf0f3..2bd6c89 100644 --- a/src/modules/commands/maps_init.lua +++ b/src/modules/commands/maps_init.lua @@ -46,11 +46,21 @@ for _, game in next, API.GAMES do if k=='count' then return self.count end -- Just to make sure it goes in the right order - for i = 1, self.count do - local v = self[i] + if type(k)=='string' then + for i = 1, self.count do + local v = self[i] - if type(v) == 'table' and v.DisplayName:lower():find(k:lower()) then - return v + if type(v) == 'table' and v.DisplayName:lower():find(tostring(k):lower()) then + return v + end + end + elseif type(k)=='number' then + for i = 1, self.count do + local v = self[i] + + if type(v) == 'table' and v.ID==k then + return v + end end end end})