From f4a03dfb403a4dd6f347e33eeff8b494082637a2 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Sat, 13 May 2017 23:46:43 -0600 Subject: [PATCH] Fix artifact count bug --- placestats.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/placestats.php b/placestats.php index d2f430b..a302aa7 100644 --- a/placestats.php +++ b/placestats.php @@ -24,11 +24,13 @@ $gameinfo['owneruuid'] = ""; // calculate artifact score $gameinfo['artifact'] = 0; -$templife = $gameinfo['currentlife']; -while ($templife > 100) { - $gameinfo['artifact']++; - $templife -= 75; +if ($gameinfo['currentlife'] > 100) { + $templife = $gameinfo['currentlife']; + while ($templife > 100) { + $gameinfo['artifact'] ++; + $templife -= 75; + } } $data['stats'] = $gameinfo; -echo json_encode($data); \ No newline at end of file +echo json_encode($data);