Fixed some Automation bug

+Fixed the (in)famous "doubling troops bug", this has been the oldest
bug I can remember, it lasted 7 years!!!
+Reworked the whole lock system, it's more maintanable and easy to read
now
+Removed some useless class fields, reworked some methods that depended
on them
This commit is contained in:
iopietro
2018-05-24 01:28:56 +02:00
parent 989296d742
commit 8605996533
2 changed files with 137 additions and 427 deletions
+3 -8
View File
@@ -1567,11 +1567,8 @@ class MYSQLi_DB implements IDbConnection {
function regenerateOasisUnits($wid, $automation = false) {
global $autoprefix;
if (is_array($wid)) {
$wid = '(' . implode('),(', $wid) . ')';
} else {
$wid = '(' . (int) $wid . ')';
}
if (is_array($wid)) $wid = '(' . implode('),(', $wid) . ')';
else $wid = '(' . (int) $wid . ')';
// load the oasis regeneration (in-game) and units generation (during install) SQL file
// and replace village IDs for the given $wid
@@ -1582,9 +1579,7 @@ class MYSQLi_DB implements IDbConnection {
// fetch results of the multi-query in order to allow subsequent query() and multi_query() calls to work
while (mysqli_more_results($this->dblink) && mysqli_next_result($this->dblink)) {;}
if (!$result) {
return false;
}
if (!$result) return false;
return true;
}