The mystery of the unseen deck

A user of C&C Napoleonics v4.0.2 has reported a bug which seems to manifest when playing from a log file into a new log file.

At a certain moment during normal use of the module, the user sees cards “disappear” from their hand window when, in fact, 1 card should be randomly selected and moved to a holding area on the the main board, whilst the others remain in hand. Internally, what is happening is that the cards move to a hidden deck for the random selection but - in this error situation - the cards move but the random selection doesn’t happen and the cards don’t return from the deck.

The error does not reproduce if the user does the action without opening a new log file. Nor, so far, can I make it reproduce from his log file by doing the actions myself.

When I look into this further, it seems the GKCs that action on the hidden deck are not “seeing” the hidden deck in the error situation. I confirmed this by adding a couple of “recovery” GKCs to retrieve the cards; one GKC that targets the deck only does not work; another that acts on all cards in the hand window map does work. In both cases, I am using “Fast Match” with the deck location.

Debug Module: CCN V4.0.3a03

Error vlog (connect as Solitaire and step through observing the Allies hand): P07B-010-P.vlog

Debug hotkeys:
Alt+Control+R hotkeys on a GKC defined on the main map to make cards visible again wherever they are within a hand window (multi-action + 2 GKCs at end of main map)

Cmd+R / Win+R hotkeys a GKC that attempts to do the same by retrieving cards from the hidden deck (fails). This is the same GKC used in the live module, that normally works.