diff options
author | Wolfram Sang <wolfram@iswi.org> | 2009-06-18 22:15:32 (GMT) |
---|---|---|
committer | Bruno Coudoin <bruno.coudoin@free.fr> | 2009-06-19 19:44:23 (GMT) |
commit | 83c5c90c69bdf53973f098592116512d9aefe510 (patch) | |
tree | 5df5d6c1e6e75c8fcbee71f3e27ebc2428ee0756 | |
parent | 44ddd5e0419d61625f014fc0bc128d7227ff5d0a (diff) |
When shuffling the items for the left bar, the last item was skipped. As the
upper limit for random-functions is exclusive, we have to pass the whole
list_size, not list_size - 1. Also, simplify the code.
-rw-r--r-- | src/boards/shapegame.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/boards/shapegame.c b/src/boards/shapegame.c index 41f1b5c..bb492b9 100644 --- a/src/boards/shapegame.c +++ b/src/boards/shapegame.c @@ -1702,7 +1702,7 @@ parse_doc(xmlDocPtr doc) { Shape *shape; - i = list_length == 1 ? 0 : g_random_int_range(0, g_list_length(shape_list_init)-1); + i = g_random_int_range(0, list_length); shape = g_list_nth_data(shape_list_init, i); add_shape_to_canvas(shape); |