From a3e2da3972aa0390f582de10fc2cd77e85bf645e Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 29 Nov 2020 12:43:52 +0100 Subject: [PATCH] fix(menumodel): fix for loop --- birb/modules/menusystem/menus/utils/menumodel.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/birb/modules/menusystem/menus/utils/menumodel.lua b/birb/modules/menusystem/menus/utils/menumodel.lua index 9c84641..ae530fc 100644 --- a/birb/modules/menusystem/menus/utils/menumodel.lua +++ b/birb/modules/menusystem/menus/utils/menumodel.lua @@ -83,8 +83,9 @@ function MenuModel:getList(first, lenght) local first = first or 1 local lenght = lenght or #self.list lenght = math.min(lenght, (#self.list + 1 - first)) + local last = (first + lenght - 1) - for i = first, lenght do + for i = first, (last) do table.insert(listWidget, self.list[i]) end