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:
@@ -560,11 +560,15 @@ func (p *AdventurePlugin) expeditionCmdRun(ctx MessageContext) error {
|
||||
// surfaces the player alive just like an extract or abandon — roll pet
|
||||
// arrival here too. The roll lives in the real callers, not in
|
||||
// runAutopilotWalk, so the sim path (which calls the walk directly)
|
||||
// never fires arrival DMs. See maybeRollPetArrivalOnEmerge.
|
||||
// never fires arrival DMs. See maybeRollPetArrivalOnEmerge. Defer it
|
||||
// behind the paced stream so the "animal in your house" DM lands after
|
||||
// the "Run complete" beat, not before it.
|
||||
var after func()
|
||||
if r.reason == stopComplete {
|
||||
p.maybeRollPetArrivalOnEmerge(ctx.Sender)
|
||||
uid := ctx.Sender
|
||||
after = func() { p.maybeRollPetArrivalOnEmerge(uid) }
|
||||
}
|
||||
return p.streamFlow(ctx.Sender, r.stream, r.finalMsg)
|
||||
return p.streamFlowThen(ctx.Sender, r.stream, r.finalMsg, after)
|
||||
}
|
||||
|
||||
// runAutopilotWalk runs the autopilot loop up to maxRooms times and
|
||||
|
||||
Reference in New Issue
Block a user