mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-30 09:34:28 +00:00
ffa04cad3a
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>