From af1b8c7ce7d9b0548b6b65751d7683ad4e19ce7a Mon Sep 17 00:00:00 2001 From: Ferywir Date: Fri, 12 Jun 2026 14:31:48 +0200 Subject: [PATCH] fix(report): restore field separator in combat report data [#203] The #155 refactor that extracted buildCombatReport() turned one comma into a literal dot in the non-scout data2 string: ...$info_chief.'.'.(isset($info_spy) ? ... // was ',' That dropped one CSV field, shifting every following field left by one (hero troops t11, casualties, prisoners 182-192) and injecting a stray "." into a numeric cell. Visible attack reports rendered with misplaced hero/prisoner data, and the shifted text in the prisoner slots is what made Templates/Notice/1.tpl array_sum() warn under PHP 8. Restore the comma so the layout matches what the report template (Notice/1.tpl) and the pre-refactor code expect. Reports stored before this fix keep their corrupted string; the int-cast guard added in the previous commit keeps them from re-emitting the warning. Co-Authored-By: Claude Opus 4.8 --- GameEngine/Automation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index e199ac65..03201c57 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -1629,7 +1629,7 @@ class Automation { .','.$unitssend_def[4].','.$unitsdead_def[4].','.$natar .','.$unitssend_def[5].','.$unitsdead_def[5] .','.$DefenderHeroesTot.','.$DefenderHeroesDead - .','.$info_ram.','.$info_cat.','.$info_chief.'.'.(isset($info_spy) ? $info_spy : '') + .','.$info_ram.','.$info_cat.','.$info_chief.','.(isset($info_spy) ? $info_spy : '') .',,'.$data['t11'].','.$dead11.','.$herosend_def.','.$deadhero .','.$unitstraped_att;