Added check to avoid showing a region list premessage if there are no regions to show.

This commit is contained in:
Lycaonj 2011-07-29 05:15:09 -05:00
parent b05f546685
commit 9d5ba1422c

View file

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