From 4df65a21b57687fa9d5861ed95178cd3f21894c6 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 Apr 2013 21:15:51 +0300 Subject: [PATCH] update: now cannot be more than one winner --- GameEngine/Automation.php | 3 +++ GameEngine/Technology.php | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index f3b3a025..693ce035 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -672,6 +672,9 @@ class Automation { if($indi['type'] == 40 and ($indi['level'] % 5 == 0 or $indi['level'] > 95) and $indi['level'] != 100){ $this->startNatarAttack($indi['level'], $indi['wid'], $indi['timestamp']); } + if($indi['type'] == 40 && $indi['level'] == 100){ //now can't be more than one winners if ww to level 100 is build by 2 users or more on same time + mysql_query("TRUNCATE ".TB_PREFIX."bdata"); + } if($database->getUserField($database->getVillageField($indi['wid'],"owner"),"tribe",0) != 1){ $q4 = "UPDATE ".TB_PREFIX."bdata set loopcon = 0 where loopcon = 1 and master = 0 and wid = ".$indi['wid']; $database->query($q4); diff --git a/GameEngine/Technology.php b/GameEngine/Technology.php index a005a1bd..8f0958f6 100644 --- a/GameEngine/Technology.php +++ b/GameEngine/Technology.php @@ -179,7 +179,11 @@ class Technology { }else{ $cropcalc = 0; } + if($unit != "u99"){ $popcalc = floor($village->getProd("crop")/$unitarray['pop']); + }else{ + $popcalc = $village->getProd("crop"); + } return min($woodcalc,$claycalc,$ironcalc,$cropcalc); }