The sell endpoint rejects valid sales during ROUND_EVAL that the game permits. Verified against vendors/lovely/dump/ and confirmed empirically.
Bug
src/lua/endpoints/sell.lua requires_state omits ROUND_EVAL, so selling a joker or consumable mid-eval returns INVALID_STATE. The game allows it: Card:can_sell_card (card.lua:1896 in the dump) has no ROUND_EVAL guard, and jokers/consumables share area.config.type == 'joker' (game.lua:2291).
Empirical: sold a joker mid-eval → money 8→9, joker removed, state stayed ROUND_EVAL.
Fix
Add G.STATES.ROUND_EVAL to requires_state and the completion-detection valid_state whitelist (~L150). Both must change or the endpoint hangs.
Sibling of #202.
The
sellendpoint rejects valid sales duringROUND_EVALthat the game permits. Verified againstvendors/lovely/dump/and confirmed empirically.Bug
src/lua/endpoints/sell.luarequires_stateomitsROUND_EVAL, so selling a joker or consumable mid-eval returnsINVALID_STATE. The game allows it:Card:can_sell_card(card.lua:1896in the dump) has noROUND_EVALguard, and jokers/consumables sharearea.config.type == 'joker'(game.lua:2291).Empirical: sold a joker mid-eval → money 8→9, joker removed, state stayed
ROUND_EVAL.Fix
Add
G.STATES.ROUND_EVALtorequires_stateand the completion-detectionvalid_statewhitelist (~L150). Both must change or the endpoint hangs.Sibling of #202.