From 89e170abe8acb7fe18efc3905b33c3cf51a0edb6 Mon Sep 17 00:00:00 2001 From: hdmaniak2 Date: Tue, 24 Feb 2026 16:26:07 +0100 Subject: [PATCH] Fix WW build task cancelled after Natar attack with 0 damage --- GameEngine/Automation.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index 1ea28d21..56c9a4c8 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -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){