mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-28 00:24:23 +00:00
6030727a0d
PHP 8.x turned several long-standing implicit accesses into runtime warnings that flooded the error log during attacks and report viewing: - Battle.report (Templates/Notice/1.tpl): the prisoner check ran array_sum() over slots that may hold non-numeric text (the "Information" line can shift indices), raising "Addition is not supported on type string". Sum int-cast values. - Database::getUnitsNumber(): movement/reinforcement arrays can be null or miss tribe-specific unit keys, raising "Undefined array key" and "Trying to access array offset on null". Null-coalesce to 0. - Automation (combat resolver): $scout was only defined for scouting attacks (type 1) yet always passed to buildCombatReport(), raising "Undefined variable $scout". Initialize it for every attack type. - Automation: the destroy-village check read $to['natar'] which is not always set, raising "Undefined array key". Use empty(). Pure null-safety / behaviour-preserving changes; no gameplay logic altered. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>