Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/boards
diff options
context:
space:
mode:
authorWolfram Sang <wolfram@iswi.org>2009-06-18 22:15:32 (GMT)
committer Bruno Coudoin <bruno.coudoin@free.fr>2009-06-18 22:15:32 (GMT)
commitdd1080968158f6d1e661d5ef1951c10f59caa51e (patch)
treed4695c7f09b8ba0c02b496b4b370c6d53a289c2c /src/boards
parent17e1ae7854b468b6ed1d89809de1159c993c2291 (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.
Diffstat (limited to 'src/boards')
-rw-r--r--src/boards/shapegame.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/boards/shapegame.c b/src/boards/shapegame.c
index d6e69f4..41d394b 100644
--- a/src/boards/shapegame.c
+++ b/src/boards/shapegame.c
@@ -1697,7 +1697,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);