Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfram Sang <wolfram@iswi.org>2009-06-19 21:47:44 (GMT)
committer Bruno Coudoin <bruno.coudoin@free.fr>2009-06-19 22:22:22 (GMT)
commit4705a291df2d4acdf386b8ad99ee0ae6a5e2fc95 (patch)
tree82c0627f53df5f0d98c1f99991bd82926b4463d2
parent4c10289f279f221431a793b94d591212e44c4c0e (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/babymatch-activity/shapegame.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/babymatch-activity/shapegame.c b/src/babymatch-activity/shapegame.c
index f143d92..92ede9b 100644
--- a/src/babymatch-activity/shapegame.c
+++ b/src/babymatch-activity/shapegame.c
@@ -1647,7 +1647,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);