mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-16 08:52:42 +00:00
Restore expedition completion on zone clear (lost in merge)
finalizeExpeditionOnZoneClear and its wiring into the run-complete seam were introduced in 73b7809 but that commit never made it into the current history — it's not an ancestor of HEAD, so the function, its call site in advanceOnceWithOpts, and its tests were all absent. Symptom: clearing a zone (boss down, no outgoing edges) set the run's boss_defeated flag but never flipped the wrapping expedition to 'complete' or retired the run. The expedition sat 'active' pointing at a boss_defeated run, so getActiveZoneRun (filters boss_defeated=0) returned nil and the next '!expedition run' errored with 'No active zone run'. The ambient ticker also kept DMing about a finished dungeon. Re-apply the bridge verbatim against current HEAD (deps verified present: IsMultiRegionZone / CurrentRegion / MarkRegionBossDefeated / completeExpedition / retireAllRegionRuns / AwardCompletionMilestones) and restore the test.
This commit is contained in:
@@ -604,6 +604,16 @@ func (p *AdventurePlugin) advanceOnceWithOpts(ctx MessageContext, compact bool)
|
||||
b.WriteString("• " + id + "\n")
|
||||
}
|
||||
}
|
||||
// Success-path expedition close-out: flip the wrapping expedition to
|
||||
// 'complete' (when this clear finishes the whole zone) and surface any
|
||||
// completion milestones. No-op for standalone runs / mid-zone region
|
||||
// clears.
|
||||
if lines := p.finalizeExpeditionOnZoneClear(ctx.Sender, run.RunID); len(lines) > 0 {
|
||||
b.WriteString("\n")
|
||||
for _, line := range lines {
|
||||
b.WriteString(line)
|
||||
}
|
||||
}
|
||||
return advanceResult{
|
||||
preStream: preStream,
|
||||
intro: intro,
|
||||
|
||||
Reference in New Issue
Block a user