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:
Brettflan 2012-11-30 19:43:04 -06:00
parent 9c7ed3bf38
commit 857892738f

View File

@ -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())