fix: reinforcements sent back do not hide the reinforcements table

This commit is contained in:
Martin Ambrus
2017-11-19 02:33:07 +01:00
parent 258ba60014
commit 07e5f322e2
4 changed files with 44 additions and 17 deletions
+11 -9
View File
@@ -820,16 +820,18 @@ private function trainUnit($unit,$amt,$great=false) {
return $generator->procMtime($reqtime);
}
public function checkReinf($id) {
public function checkReinf($id, $use_cache = true) {
global $database;
$enforce=$database->getEnforceArray($id,0);
$fail='0';
for($i=1; $i<50; $i++){
if($enforce['u'.$i.'']>0){
$fail='1';
}
}
if ($enforce['hero']>0) $fail='1';
$enforce=$database->getEnforceArray($id, 0, $use_cache);
$fail=0;
for ($i=1; $i<50; $i++) {
if($enforce['u'.$i.'']>0){
$fail=1;
}
}
if ($enforce['hero']>0) $fail=1;
if($fail==0){
$database->deleteReinf($id);
}