Card-Forge/forge

Android - Hot seat commander 2 human players - Can't spend 2nd player mana

Closed this issue · 5 comments

Describe the bug
While playing commander with hotseat enabled and 2 human players, the second human player is unable to spend its mana (tapping on the mana symbol does nothing)

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Options'
  2. Enable 'Hot Seat Mode'
  3. Go to 'New Game'
  4. Select commander
  5. Set players to two
  6. Set both of them to humans
  7. 2nd player turn (the player on the top of the screen)
  8. Play 'Cavern of Souls', choose 'Human'
  9. Tap 'Cavern of Souls' for white mana
  10. Cast 'Serra Ascendant'
  11. Try to tap on the white mana symbol with value '1' to spend it
  12. Error occurs, clicking on the mana symbol does nothing

Expected behavior
Mana of the 2nd player can be spent normally while 'Hot Seat Mode' is enabled and player is 'Human'

Screenshots
Can't easily demonstrate the problem with a screenshot.

Smartphone:

  • Device: Sony xperia iv
  • OS: Android 14
  • App Version: forge-android-2.0.01-SNAPSHOT-12.06

Additional context
None.

Should be fixed by #6692.

does it still work for netplay client + server?

I wasn't able to test net-play, and I'll admit to not understanding much about how the net-code works yet. But I believe the solution I used matches what the desktop UI does in the same situation. I figured that unless I missed something, if there was an issue with net-play under that logic, it would have manifested on desktop long ago. Can revert or revise if something goes wrong.

Mostly just wondering since it looks way hackier now and I didn't find a connection with FPref.MATCH_HOT_SEAT_MODE

Jetz72 commented

I'm inclined to agree that it looks messier; I was hesitant to clean it up when I didn't fully understand it, but the logic should probably be shifted elsewhere and the conditions there should be more abstract - "is this player a local human" and "is this player being prompted for input".

The original logic's method GamePlayerUtil.getGUIPlayer seems built on the assumption that only one local human player exists. It's used in many other places and I didn't check them all, so it's possible other similar errors are around. A more complete solution would be to build a helper method to answer "is this player a local human" and swap it in both here and anywhere else that it's appropriate.

As for FPref.MATCH_HOT_SEAT_MOD, I believe all that affects is whether player 2 is displayed either normally (when enabled), or upside down and with their own prompt text at the opposite end of the screen (when disabled). With it disabled, you could run the game on a tablet laid flat on a table with two players sitting at opposite ends of it. Doesn't seem to affect any other UI, lobby player, player controller, or gameplay logic.