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 <noreply@anthropic.com>
This commit is contained in:
Ferywir
2026-06-12 14:31:48 +02:00
committed by Catalin Novgorodschi
parent 6030727a0d
commit af1b8c7ce7
+1 -1
View File
@@ -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;