mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-01 01:54:22 +00:00
89b0fa50f5
The defender's units were gathered by two near-identical inline blocks (village and oasis targets). Extract them into a single private method buildDefenderUnits() returning the defender's own troops (normalised to non-negative ints), the aggregated reinforcement totals (enforDefender) and the raw reinforcement rows (enforcementarray). Pure behaviour-preserving extraction: - Both call sites assign the returned bundle; all downstream usages unchanged. - The oasis reinforcement aggregation now uses the same isset-guarded loop as the village one: identical numeric result, minus a latent PHP 8.3 "undefined array key" notice. - The dead `$def_ab[$i] = 0` init that lived in the village normalisation loop is dropped: it was unconditionally wiped by the later `$def_ab = []` before any use. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>