Files
TravianZ/GameEngine
Ferywir f849260bfa fix(combat): stop attacks looping on a village razed earlier in the same tick [#298] (#309)
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>
2026-06-29 12:18:38 +03:00
..
2026-06-29 11:42:22 +03:00
2026-06-29 08:02:09 +03:00
2026-05-15 08:17:14 +03:00
2026-06-29 08:02:09 +03:00
2026-05-07 08:24:40 +03:00
2026-05-28 12:25:28 +03:00
2026-05-15 08:17:14 +03:00
2026-05-15 08:17:14 +03:00
2026-06-09 15:15:27 +03:00
2026-05-15 08:17:14 +03:00
2026-06-29 07:49:49 +03:00
2026-05-15 08:17:14 +03:00
2026-06-29 08:02:09 +03:00
2026-06-29 08:02:09 +03:00
2026-06-29 08:02:09 +03:00