Merge pull request #274 from Lycaonj/master
Region count check for "/region list"
This commit is contained in:
commit
b1e1a1db41
1 changed files with 7 additions and 0 deletions
|
|
@ -1651,6 +1651,13 @@ namespace TShockAPI
|
|||
|
||||
var regions = TShock.Regions.ListAllRegions(Main.worldID.ToString());
|
||||
|
||||
// Are there even any regions to display?
|
||||
if (regions.Count == 0)
|
||||
{
|
||||
args.Player.SendMessage("There are currently no regions defined.", Color.Red);
|
||||
return;
|
||||
}
|
||||
|
||||
//Check if they are trying to access a page that doesn't exist.
|
||||
int pagecount = regions.Count / pagelimit;
|
||||
if (page > pagecount)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue