fix for /f list command throwing an error if an invalid page number was specified (ex. 5 pages available and they run /f list 6)
This commit is contained in:
parent
9c7ed3bf38
commit
857892738f
@ -96,6 +96,10 @@ public class CmdList extends FCommand
|
||||
final int pageheight = 9;
|
||||
int pagenumber = this.argAsInt(0, 1);
|
||||
int pagecount = (factionList.size() / pageheight) + 1;
|
||||
if (pagenumber > pagecount)
|
||||
pagenumber = pagecount;
|
||||
else if (pagenumber < 1)
|
||||
pagenumber = 1;
|
||||
int start = (pagenumber - 1) * pageheight;
|
||||
int end = start + pageheight;
|
||||
if (end > factionList.size())
|
||||
|
Loading…
Reference in New Issue
Block a user