Merge pull request #133 from hdmaniak2/fix-WW-build-task-cancellation

Fix WW build task cancelled after Natar attack with 0 damage (issue #67)
This commit is contained in:
Catalin Novgorodschi
2026-03-03 09:34:41 +02:00
committed by GitHub
+4 -2
View File
@@ -722,8 +722,10 @@ class Automation {
$newLevel = $battle->calculateNewBuildingLevel($tblevel, $catapultsDamage / ($twoRowsCatapultSetup ? 2 : 1));
//If that building was present in the building queue, we have to modify his level or remove it
$database->modifyBData($data['to'], $tbid, [$newLevel, $tblevel], $tribe);
//fix: Only modify build queue if actual damage was dealt
if ($newLevel < $tblevel) {
$database->modifyBData($data['to'], $tbid, [$newLevel, $tblevel], $tribe);
}
// building/field destroyed
if ($newLevel == 0){