mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-16 08:52:42 +00:00
Pet arrival: fire after run narration, not before
The run-complete emergence seam rolled the pet-arrival DM synchronously, then handed the run narration to streamFlow's paced (fire-and-forget) streamer. The 'animal in your house' prompt landed ahead of the queued 'Run complete' + loot beats. Add streamFlowThen to run the roll after the final message is delivered; fix the same inverted order in tryAutoRun.
This commit is contained in:
@@ -165,17 +165,17 @@ func (p *AdventurePlugin) tryAutoRun(e *Expedition, now time.Time) error {
|
||||
}
|
||||
// Emergence seam: a run-complete reached by the background ticker is
|
||||
// still a live emergence — roll pet arrival. See maybeRollPetArrivalOnEmerge.
|
||||
// Deferred until after the run-summary DM below so the "animal in your
|
||||
// house" prompt lands after the summary, not ahead of it.
|
||||
if shouldDMAutoRun(r) {
|
||||
body := renderAutoRunDM(r)
|
||||
if err := p.SendDM(uid, body); err != nil {
|
||||
slog.Warn("expedition: autorun DM", "user", uid, "err", err)
|
||||
}
|
||||
}
|
||||
if r.reason == stopComplete {
|
||||
p.maybeRollPetArrivalOnEmerge(uid)
|
||||
}
|
||||
if !shouldDMAutoRun(r) {
|
||||
return nil
|
||||
}
|
||||
|
||||
body := renderAutoRunDM(r)
|
||||
if err := p.SendDM(uid, body); err != nil {
|
||||
slog.Warn("expedition: autorun DM", "user", uid, "err", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user