Fixed trap bugs

+Released troops will now return to their respective villages correctly,
(allied or own villages)
+Fixed "Released X of own troops" and "Released X of friendly troops"
texts, they'll now match the correct amount of own/friendly released
troops.
+Fixed a bug that didn't permit to release troops in the first attack or
if in the attacked village there were prisoners from more than one
village
+Corrected a wrong stolen resources calculation
+Minor improovements and bug fixing
This commit is contained in:
iopietro
2018-05-01 00:09:58 +02:00
parent 0fac64b23a
commit 2fc3e7b7da
4 changed files with 192 additions and 268 deletions
+5 -5
View File
@@ -7695,7 +7695,7 @@ References: User ID/Message ID, Mode
return mysqli_query($this->dblink,$q);
}
function getPrisoners($wid,$mode=0, $use_cache = true) {
function getPrisoners($wid,$mode = 0, $use_cache = true) {
$array_passed = is_array($wid);
$mode = (int) $mode;
@@ -7751,12 +7751,12 @@ References: User ID/Message ID, Mode
self::$prisonersCache[$wid[0].$mode] = (count($result) ? [$result] : []);
} else {
if ($result && count($result)) {
if (!isset(self::$prisonersCache[ $record[ ( $mode ? 'from' : 'wref' ) ] . $mode ])) {
self::$prisonersCache[ $record[ ( $mode ? 'from' : 'wref' ) ] . $mode ] = [];
if (!isset(self::$prisonersCache[$record[($mode ? 'from' : 'wref')].$mode])) {
self::$prisonersCache[$record[($mode ? 'from' : 'wref' )].$mode] = [];
}
foreach ( $result as $record ) {
self::$prisonersCache[ $record[ ( $mode ? 'from' : 'wref' ) ] . $mode ][] = $record;
foreach ($result as $record) {
self::$prisonersCache[$record[($mode ? 'from' : 'wref')].$mode][] = $record;
}
}