From bdca64eed3c973a7cf4da0d4c3d8cb0b1d68b904 Mon Sep 17 00:00:00 2001 From: iopietro Date: Sun, 8 Apr 2018 23:29:36 +0200 Subject: [PATCH] Fixed a bug in medals Medals are now given at the right date --- GameEngine/Automation.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index dc0ca599..f278250c 100755 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -2120,7 +2120,7 @@ class Automation { }else{ $artefact_bouns = 1; } - $foolartefact = $database->getFoolArtefactInfo(7,(isset($vid) ? $vid : 0),$session->uid); + $foolartefact = $database->getFoolArtefactInfo(7, (isset($vid) ? $vid : 0), $DefenderID); if(count($foolartefact) > 0){ foreach($foolartefact as $arte){ if($arte['bad_effect'] == 1){ @@ -5373,10 +5373,10 @@ class Automation { $newtime = time()+MEDALINTERVAL; $q = "UPDATE ".TB_PREFIX."config SET lastgavemedal=".(int) $newtime; $database->query($q); - $row['lastgavemedal'] = time()+MEDALINTERVAL; - } - $time = $row['lastgavemedal'] + MEDALINTERVAL; - if ($time < time()) $giveMedal = true; + }elseif($row['lastgavemedal'] != 0){ + $time = $row['lastgavemedal'] + MEDALINTERVAL; + $giveMedal = $row['lastgavemedal'] < time(); + } } if($giveMedal && MEDALINTERVAL > 0){