mirror of
https://github.com/prosolis/gogobee.git
synced 2026-09-14 10:51:09 +00:00
adventure: stop the log claiming a win it didn't see
Four things the review found, all of them the code telling a player something that isn't true. A run that walks into a dead end filed its ending as "cleared" whatever the caller said, so both the liveblog and the summary reported a clear for a party that merely ran out of map — and the end beat is first-writer-wins, so nothing later could take it back. It says "cleared" only for a boss now. The re-offer branches of babysit and resume returned a zero cost, so a player who was in fact charged read "0 coins" in the verdict. Both re-quote the price they actually took. And the realm-firsts reseed retired its one-shot job even when the read under it had failed, which on a transient fault at Init would have left the ledger mis-dated permanently. The read now says whether it worked, and the job stays open when it didn't. Claude-Session: https://claude.ai/code/session_012bxpQQJDjC1mTtLN3VVtBQ
This commit is contained in:
@@ -144,7 +144,14 @@ func (p *AdventurePlugin) performBabysitPurchase(uid id.UserID, days int, idemKe
|
||||
// on the re-offer. The settled fee is what tells that apart from somebody
|
||||
// who really does already have one.
|
||||
if idemKey != "" && p.euro != nil && p.euro.HasExternalTx(idemKey) {
|
||||
return babysitOutcome{Days: days, PetName: char.PetName}, nil
|
||||
// Re-quote the fee rather than leaving it zero: the verdict this
|
||||
// feeds prints the coin figure, and "0 coins" would be a false
|
||||
// receipt for a hire the player did pay for.
|
||||
return babysitOutcome{
|
||||
Days: days,
|
||||
Cost: babysitDailyCost(dndLevelForUser(char.UserID)) * days,
|
||||
PetName: char.PetName,
|
||||
}, nil
|
||||
}
|
||||
return babysitOutcome{}, refuseAdv(errBabysitActive, "🍼 The babysitter is already here. They're not leaving until the job is done.")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user