update: now cannot be more than one winner

This commit is contained in:
unknown
2013-04-22 21:15:51 +03:00
parent 73778f37e2
commit 4df65a21b5
2 changed files with 7 additions and 0 deletions
+3
View File
@@ -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);
+4
View File
@@ -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);
}