From 6909ba4e5881fedf45504529103d10fda5704daa Mon Sep 17 00:00:00 2001 From: iopietro Date: Wed, 16 May 2018 18:44:06 +0200 Subject: [PATCH] Fixed a medals bug +First medals will now be given on the next Sunday (at 12 PM) from the start of the server --- GameEngine/Automation.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index a055270a..161ad7ca 100755 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -4573,11 +4573,11 @@ class Automation { $q = "SELECT lastgavemedal FROM ".TB_PREFIX."config"; $result = mysqli_query($database->dblink,$q); if($result) { - $row=mysqli_fetch_assoc($result); - $stime = strtotime(START_DATE)-strtotime(date('m/d/Y'))+strtotime(START_TIME); + $row = mysqli_fetch_assoc($result); + $stime = strtotime(START_DATE) - strtotime(date('m/d/Y')) + strtotime(START_TIME); if($row['lastgavemedal'] == 0 && $stime < time()){ - $newtime = time()+MEDALINTERVAL; - $q = "UPDATE ".TB_PREFIX."config SET lastgavemedal=".(int) $newtime; + $newtime = strtotime('next monday'); + $q = "UPDATE ".TB_PREFIX."config SET lastgavemedal = ".(int) $newtime; $database->query($q); }elseif($row['lastgavemedal'] != 0){ $time = $row['lastgavemedal'] + MEDALINTERVAL;