Fixed trap bugs

+Traps are now repaired (built) in the trapper building, instead of
instantly given after a successful normal attack or a dismiss/releasing
from the rally point
+1/4 of trapped troops are now lost after a successful normal attack
+Traps are now released when troops die from starvation
+If you'll dismiss your trapped troops from the rally point, the gaul
player will be able to only repair 1/3 of the total used traps
+Created a new method to delete some redundant and duplicated code
starvation related
+The effect of WW building plans will be displayed correctly, when
they're active
+Troops related artifacts are now counted when building traps
+Some minor improovements and bug fixing
+Some clean-up
This commit is contained in:
iopietro
2018-05-02 21:17:20 +02:00
parent 8a760b0aec
commit 9e2d2b6842
8 changed files with 485 additions and 584 deletions
+4 -4
View File
@@ -855,7 +855,7 @@ class MYSQLi_DB implements IDbConnection {
return $ret;
}
// no n eed to cache this method
// no need to cache this method
function getSitee($uid) {
list($uid) = $this->escape_input((int) $uid);
@@ -6111,13 +6111,13 @@ References: User ID/Message ID, Mode
else{$unit = 'u' . $unit;}
++$i;
//Fixed part of negativ troops (double troops) - by InCube
//Fixed part of negative troops (double troops) - by InCube
$array_amt[$i] = (int) $array_amt[$i] < 0 ? 0 : $array_amt[$i];
//Fixed part of negativ troops (double troops) - by InCube
//Fixed part of negative troops (double troops) - by InCube
$units .= $unit.' = '.$unit.' '.(($array_mode[$i] == 1)? '+':'-').' '.($array_amt[$i] ? $array_amt[$i] : 0).(($number > $i+1) ? ', ' : '');
}
$q = "UPDATE ".TB_PREFIX."units set $units WHERE vref = $vref";
return mysqli_query($this->dblink,$q);
return mysqli_query($this->dblink, $q);
}
function getEnforce($vid, $from, $use_cache = true) {