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
066ec5cadb
commit
9e4cc676ea
@ -94,6 +94,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