From 724b9a05454c380ec2f0e06ac5defde1db259be9 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 2 May 2017 16:45:01 -0400 Subject: [PATCH] Oh....duh... --- Project-Unite/Controllers/ForumController.cs | 2 +- Project-Unite/Controllers/StatsController.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Project-Unite/Controllers/ForumController.cs b/Project-Unite/Controllers/ForumController.cs index 4abac8c..de2174c 100644 --- a/Project-Unite/Controllers/ForumController.cs +++ b/Project-Unite/Controllers/ForumController.cs @@ -351,7 +351,7 @@ public static T[] GetItemsOnPage(this T[] collection, int page, int pageSize) { List obj = new List(); - for(int i = pageSize * page; i < pageSize + (pageSize * page) + 1 && i < collection.Count(); i++) + for(int i = pageSize * page; i < pageSize + (pageSize * page) && i < collection.Count(); i++) { obj.Add(collection[i]); } diff --git a/Project-Unite/Controllers/StatsController.cs b/Project-Unite/Controllers/StatsController.cs index 1306f8e..1fbf851 100644 --- a/Project-Unite/Controllers/StatsController.cs +++ b/Project-Unite/Controllers/StatsController.cs @@ -25,6 +25,8 @@ public ActionResult Pong(int id = 1) }); } + id = id - 1; + int pagecount = highscores.GetPageCount(10); if (id > pagecount || id < 1) return new HttpStatusCodeResult(HttpStatusCode.BadRequest);