mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-30 17:44:22 +00:00
f849260bfa
When several catapult waves land in the same resolution tick, sendunitsComplete() fetches them all into one in-memory batch. The first wave can raze the target village: handleVillageDestruction() -> DelVillage() already bounces every still-in-flight attack straight home (symmetric return time) and deletes the vdata row, leaving the wdata tile as an empty valley. The loop then kept resolving the remaining waves from the in-memory batch against the now-deleted village. getMInfo() LEFT-JOINs wdata onto the missing vdata, so every vdata column (including wref) comes back NULL. The return trip in finalizeReturnOrDeath() is then computed from a NULL wref (NULL coordinates), producing a bogus arrival time that strands the troops, and a duplicate of the bounce DelVillage() had already issued. The attacker sees the waves "coming to nowhere and never coming back" (issue #298). Track the tiles razed during the current batch and skip any follow-up wave that targets one of them: those troops were already bounced home by DelVillage(). No change to the battle maths; for a normal (non-razed) target the set stays empty, so behaviour is preserved. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>