mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-16 08:52:42 +00:00
Pet adoption: stop double-deleting pending, pass interaction to resolvePetName
resolvePendingInteraction deletes the pending entry before dispatch, but resolvePetName then re-ran LoadAndDelete to recover the carried PetType. That second lookup always missed, so the if !ok branch returned nil: the save never ran and no pet was ever persisted (adoption was 100% broken). Pass the already-loaded interaction in, matching every other handler. Add a regression test driving the real dispatcher path.
This commit is contained in:
@@ -853,7 +853,7 @@ func (p *AdventurePlugin) resolvePendingInteraction(ctx MessageContext, interact
|
||||
case "pet_type":
|
||||
return p.resolvePetType(ctx)
|
||||
case "pet_name":
|
||||
return p.resolvePetName(ctx)
|
||||
return p.resolvePetName(ctx, interaction)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user