Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#18471 - [foobillard] 3.0a-4 breaks after snooker game ends

Attached to Project: Arch Linux
Opened by Émeric Dupont (emeric) - Friday, 26 February 2010, 05:30 GMT
Last edited by Dan Griffiths (Ghost1227) - Saturday, 27 February 2010, 10:08 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Eric Belanger (Snowman)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Once a game of snooker has reached its end, any new game started later, no matter what game type, will be in a "training" kind of mode, where the white ball can be moved anywhere, balls do not reappear when they should, and points are not counted. Restarting the application is the only way to get back to the expected behavior, and this is not an acceptable solution when playing in tournament mode for example.


Additional info:
* package version(s) 3.0a-4
* config and/or log files etc.
Log output for the last two turns of a game,
[Paste]
EVAL start
EVAL to_play=7
EVAL b1hit=7
EVAL no foul
EVAL next player
EVAL to_play=7
EVAL done
EVAL start
EVAL to_play=7
EVAL b1hit=7
EVAL ball out:7
EVAL no foul
EVAL to_play=8
EVAL done
[/Paste]

Then the begin of a new game
[Paste]
player_copy1
player_copy2
player_copy3
human player 1
player_copy3.5
player_copy4
player_copy1
player_copy2
player_copy3
human player 2
player_copy3.5
player_copy4
[/Paste]
The "EVAL" steps do not appear anymore, even after playing some balls.


Steps to reproduce:
$ foobillard --snooker
Finish the game (This is long, I know it)
Start a new game (Using menus, or simply press 'N' to restart a snooker game)
The game is now in the invalid state described above.
This task depends upon

Closed by  Dan Griffiths (Ghost1227)
Saturday, 27 February 2010, 10:08 GMT
Reason for closing:  Fixed
Comment by Émeric Dupont (emeric) - Friday, 26 February 2010, 06:14 GMT
Some details gathered from the source code (I could not find the "official" source code, but I fetched version 3.0a from http://repository.slacky.eu/slackware-11.0/games/foobillard/3.0a/src/foobillard-3.0a.tar.gz, then applied the patches for version 3.0a-4 found in svn under packages/foobillard/trunk) :

When playing snooker, the game stores the ball "to be played" in a member of the global instance snooker_state. This member is initialized on application start to SN_PLAY_RED, and ends up being SN_BLACK, then SN_DONE when the game ends. This seems to be a correct behavior.
However, the member snooker_state.to_play is NEVER reset to SN_PLAY_RED once the game has ended, nor when a new game starts, and this seems to be the reason why the application ends up in this invalid state. (Actually, [changing game type to something else](not really needed, you can change directly to snooker) then changing it back to snooker does reset snooker_state.to_play to SN_PLAY_RED, since it calls set_gametype() from billard3d.c, but this is not possible for tournaments.)

I don't know how much this can help, but I applied following patch, and it solves the issue for snooker tournaments :
*** /tmp/old 2010-02-26 06:53:36.699096670 +0100
--- src/billard3d.c 2010-02-25 18:53:56.207374372 +0100
***************
*** 1219,1224 ****
--- 1219,1226 ----
printf("tournament_state_setup_next_match 7\n");
queue_view=player[act_player].queue_view;
printf("tournament_state_setup_next_match 8\n");
+ snooker_state.to_play = SN_PLAY_RED;
+ printf("tournament_state_setup_next_match 9\n");
}

void create_players_text()

Loading...