Merge pull request #274 from Lycaonj/master

Region count check for "/region list"
This commit is contained in:
Steven French 2011-07-29 03:30:53 -07:00
commit b1e1a1db41

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)