Page 1 of 1

Lua Docs Inventory.getbar - misleading description

Posted: Wed Feb 14, 2018 2:27 am
by wvlad
Assuming indexes in lua start from 1.
getbar() → uint
Get the current bar. This is the index at which the red area starts.
When I called setbar(1) it set 1 slot free and others locked. Which means that when I call getbar() it will return 1 but red area will actually start from index 2. So getbar() returns the index before the red area starts.

Re: Lua Docs Inventory.getbar - misleading description

Posted: Wed Feb 14, 2018 6:46 am
by Rseding91
Thanks for the report. The description is correct just it was using zero-based indexing instead of lua 1-based.

To set 1 slot free you would use setbar(2) so the bar starts at the begining of slot #2. to set no slots free you would start the bar at slot 1.

I've fixed it for the next version of 0.16. so it uses 1-based indexing.