Invalid cards allowed to be played

Bug #235044 reported by matt felser
4
Affects Status Importance Assigned to Milestone
gnome-hearts
Fix Released
Medium
gnome-hearts (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: gnome-hearts

The game_is_valid_card() function, which returns a boolean, is called incorrectly somewhere, allowing invalid cards to be used.

To reproduce:
Immediately after receiving 3 cards from another player, hover your mouse over any card. This card should be highlighted, signifying that it may be played. Click once to start the game. If you click again, you will play the card that your mouse is over, regardless of whether it may be played following the rules of Hearts.

Alternately:
After playing a card, hover your mouse over any other card that was playable on that trick. Click to move onto the next trick. If you click again, you will play the card that your mouse is over, regardless of whether it may be played following the rules of Hearts.

Revision history for this message
matt felser (mfelser) wrote :

After playing around with this glitch for a while, I ended up crashing the program. The output is below.

Traceback (most recent call last):
  File "/usr/share/gnome-hearts/stock_ai.py", line 95, in play_card
    return valid_cards[0]
IndexError: list index out of range
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/apport_python_hook.py", line 71, in apport_excepthook
    pr['PythonArgs'] = '%r' % sys.argv
AttributeError: 'module' object has no attribute 'argv'

Original exception was:
Traceback (most recent call last):
  File "/usr/share/gnome-hearts/stock_ai.py", line 95, in play_card
    return valid_cards[0]
IndexError: list index out of range

** ERROR **: file player.c: line 120 (player_play): should not be reached
aborting...
Aborted

Revision history for this message
Andrew Starr-Bochicchio (andrewsomething) wrote :

From upstream bug:

"I've fixed the bug in the subversion trunk with r187.
Gnome-hearts-0.2.2 is isn't too far away and it will include this fix.

Apparently, when you move the mouse while you click, it's possible to click on
a different card than the (valid) card that is highlighted. The game now checks
the card for validity and will ignore the click if the card is invalid.

Kind regards,

--
Sander Marechal"

Changed in gnome-hearts:
importance: Undecided → Low
status: New → Triaged
Changed in hearts:
status: Unknown → Fix Released
Revision history for this message
Alessio Treglia (quadrispro) wrote :

New version available in intrepid should fix this bug.

Changed in gnome-hearts:
status: Triaged → Fix Released
Changed in hearts:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.