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:
prosolis
2026-05-22 08:42:47 -07:00
parent b167882e3e
commit 7dbfa0b56f
3 changed files with 60 additions and 11 deletions

View File

@@ -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
}