[gcompris/gcomprixogoo] When shuffling the items for the left bar, the last item was skipped. As the
- From: Bruno Coudoin <bcoudoin src gnome org>
- To: svn-commits-list gnome org
- Subject: [gcompris/gcomprixogoo] When shuffling the items for the left bar, the last item was skipped. As the
- Date: Fri, 19 Jun 2009 17:53:14 -0400 (EDT)
commit e27e05da887270cce7d0f6ff3f112b0d98fabb8b
Author: Wolfram Sang <wolfram iswi org>
Date: Fri Jun 19 23:47:44 2009 +0200
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.
src/babymatch-activity/shapegame.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/babymatch-activity/shapegame.c b/src/babymatch-activity/shapegame.c
index 0ad8159..60ee771 100644
--- a/src/babymatch-activity/shapegame.c
+++ b/src/babymatch-activity/shapegame.c
@@ -1683,7 +1683,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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]