Files
TravianZ/GameEngine
Ferywir ffa04cad3a fix(combat): bounce attacks home when their target village no longer exists [#298] (#310)
Follow-up to #309. That fix only skipped follow-up waves whose target
was razed within the same resolution batch (an in-memory set). But waves
timed a second apart land in separate ticks: the first razes the village,
the next tick re-resolves the follow-up wave against a village that no
longer exists. getMInfo() (wdata LEFT JOIN vdata) then returns NULL vdata
columns, so the return trip is computed from a NULL wref (NULL coords) ->
a bogus arrival time that strands the troops forever (report against
"[?]"); DelVillage() does not reliably bounce every in-flight wave
either, leaving the attack at proc=0 and re-fetched every tick.

Detect the razed target from DB truth: after resolveVillageTarget(), if
the village is gone ($to['wref'] is NULL) or it was razed earlier in this
same batch ($razedTargets, still needed because getMInfo() is cached and
a same-batch wave would otherwise see the stale "alive" row), bounce the
whole army straight home and mark the movement processed instead of
fighting a phantom. setMovementProc() returns true only when it flips
proc 0->1, so we never duplicate a return DelVillage() already created.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 13:52:31 +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