Sorry, we don't support your browser.  Install a modern browser
This post is closed.

Hand Select Mode Bugs#2618

Version: public_beta as of Nov 18, 2025

This is a couple bugs with the Hand Select Mode, and the fixes necessary to resolve them.
All fix code has been tested.

— Hotseat NullReferenceException —

Passing the turn in a hotseat game while the Hand Select Mode is active throws a NullReferenceException in HandZone.PositionHandObjects at IL offset 0x05cb, which refers to the static field load (ldsfld) of PlayerScript.PointerScript in the following code:

Singleton<HandSelectMode>.Instance.IsActive && this == HandZone.GetHandZone(PlayerScript.PointerScript.PointerColorLabel, 0, false);

(note this is decompiled code so it may not match exactly)

Because hotseat player pointers cease to exist when the turn changes, a NullReferenceException is thrown.

To reproduce:

  • Start a new hotseat game with at least two players
  • Put some cards in your hand
  • console: lua chooseInHand("first", 1, 1, "first!", { "White" })
  • Pass the turn
  • observe: All the cards fall out of the hand
  • observe: Moving the cards out of the hand does not solve the issue, they are still hidden and do not hover in hand zones like usual
  • Pass the turn around back to the player you started as
  • observe: The cards will still show up on screen, so they are still considered “In” the hand zone
  • observe: The hand select UI shows up again
  • Click one of the cards
  • Accept the hand selection
  • observe: The hand selection is still broken

Fix:
in the HandZone.PositionHandObjects method, when checking for:

  • if the HandSelectMode is active
  • if the current HandZone is the same as hand zone 0 for the pointer PlayerScript.PointerScript

add a null check:

Singleton<HandSelectMode>.Instance.IsActive && PlayerScript.PointerScript != null && this == HandZone.GetHandZone(PlayerScript.PointerScript.PointerColorLabel, 0, false);

— Queued hand selections cause problems —

Starting another hand selection while one is currently in progress for a given player causes issues.

This seems to be because the active hand zone is cleared after the next item in the queue is loaded, causing a broken state.

To reproduce:

  • Start a new blank game as the White seat
  • Spawn a standard deck
  • Put a few cards in your hand zone
  • console: lua function onPlayerHandChoice(_, label, _, _) log(label) end
  • console: lua chooseInHand("first", 1, 1, "first!", { "White" })
  • console: lua chooseInHand("second", 1, 1, "second!", { "White" })
  • console: lua chooseInHand("third", 1, 1, "third!", { "White" })
  • Choose a card and accept the “first!” selection
  • observe: Console prints “first”
  • observe: The selection prompt shows “second!” now
  • observe: Despite needing a minimum card count of 1 selected, the check mark button is enabled
  • Attempt to click a card in hand to select it
  • observe: Instead the card is just picked up like usual
  • Click the accept button, even though no cards are selected
  • observe: No console print
  • observe: No prompt for the third
  • console: lua chooseInHand("fourth", 1, 1, "fourth!", { "White" })
  • observe: Prompt now displays “second!”
  • Select a card and accept
  • observe: Console prints “second”
  • observe: “third!” shows up after this, the cycle repeats

Fix:
in the HandSelectMode.EndHandSelectMode method, move these two operations:

selectedNPOs.Clear();
this.ActiveHandZone = null;

above the if(doCallback) { ... } block, and before zeroing ActiveHandZone, store the reference in a local, so you can use it in the doCallback if statement:

this.selectedNPOs.Clear();
HandZone hz = this.ActiveHandZone;
this.ActiveHandZone = null;
if (doCallback)
{
    List<LuaGameObjectScript> list = (confirmed ? this.selectedNPOs.ToLGOS((NetworkPhysicsObject npo) => hz.ContainedNPOs.Contains(npo)) : new List<LuaGameObjectScript>());
    if (this.preset == null)
    {
        EventManager.TriggerHandSelectModeEnd(hz.TriggerLabel, this.label, list, confirmed);
    }
    hz.EndHandSelectMode();
}
7 months ago
Changed the status to
Planned
7 months ago
Changed the status to
In Progress
7 months ago
Changed the status to
Completed
7 months ago