After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 438829 - Robots dies on level 64 with a score near 250000
Robots dies on level 64 with a score near 250000
Status: RESOLVED FIXED
Product: gnome-games-superseded
Classification: Deprecated
Component: gnobots2
2.18.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Games maintainers
GNOME Games maintainers
Depends on:
Blocks:
 
 
Reported: 2007-05-16 09:28 UTC by Ferenc Gerlits
Modified: 2007-07-13 01:01 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
this patch fixes the bug (879 bytes, patch)
2007-05-16 09:31 UTC, Ferenc Gerlits
none Details | Review
the same patch as 88265, but against the SVN HEAD (942 bytes, patch)
2007-05-27 16:39 UTC, Ferenc Gerlits
accepted-commit_now Details | Review

Description Ferenc Gerlits 2007-05-16 09:28:03 UTC
+++ This bug was initially created as a clone of Bug #353303 +++

Bug #353303 is still happening; the patch in #353303 did not fix it.

Description of the bug: if there are so many robots that there are no safe teleports left, and you press the safe teleport button, the program freezes.

The problem is that in the safe_teleport() function in gnobots2/game.c, safe_teleport_available() is only checked when properties_super_safe_moves() is true; and when it isn't checked, the code gets stuck in the while (1) { ... } loop a few lines further down.

BTW, you do not need to play to level 64 to test the bug; just change the initial number of robots in /usr/share/<variant>.cfg to some huge number (type1 = 200 and type2 = 400, for example) before starting gnobots2.
Comment 1 Ferenc Gerlits 2007-05-16 09:31:40 UTC
Created attachment 88265 [details] [review]
this patch fixes the bug
Comment 2 Ferenc Gerlits 2007-05-16 09:34:49 UTC
> initial number of robots in /usr/share/<variant>.cfg to some huge number (type1

That should be /usr/share/gnobots2/<variant>.cfg, or course.
Comment 3 Ferenc Gerlits 2007-05-27 16:39:41 UTC
Created attachment 88892 [details] [review]
the same patch as 88265, but against the SVN HEAD
Comment 4 Thomas Andersen 2007-06-26 03:16:30 UTC
Confirmed.

The current code is bogus. If you can't teleport to any safe place, then you can't move to any safe place either. Or randomly teleport to any. It just doesn't make sense.

So the patch looks good to me.

(btw. this is actually a duplicate of bug #395447)
Comment 5 Thomas Andersen 2007-07-13 01:01:33 UTC
Committed to trunk. Thanks for the patch Ferenc!