GNOME Bugzilla – Bug 762835
assertion failed: (_size > 0) in worm_reduce_tail when eating two bonuses in rapid succession
Last modified: 2016-03-04 00:09:56 UTC
I made it quite far (past the first teleporter level) without any deaths, and picked up two bonus lives as well. Probably my best game so far. Then it crashed. :( It spawned an apple and a cherry, the apple looked like it was exactly one spot below the cherry. My worm ate the apple and was surely going to eat the cherry next, but it crashed (while eating the cherry, according to the backtrace).
+ Trace 236012
Thread 1 (Thread 0x7f45875dda80 (LWP 29842))
I see erase_size was 10, and it crashed on the fifth iteration of the loop for (int i = 0; i < erase_size; i++). I'm not quite sure what is wrong with the code, though....
putting crashes on the target list
Created attachment 323022 [details] [review] Apply bonus type HALF based on current length When reducing the worm's length to half, the total length was actually the sum of the worm's length and the length that was going to be earned/ lost if the worm previously consumed another bonus. Reduce the worm's length based on the length shown when the HALF bonus is consumed. Knowing the exact scenario (eat apple then the cherry) helped a lot. Thanks :)
The following fix has been pushed: 65ec002 Apply bonus type HALF based on current length
Created attachment 323023 [details] [review] Apply bonus type HALF based on current length When reducing the worm's length to half, the total length was actually the sum of the worm's length and the length that was going to be earned/ lost if the worm previously consumed another bonus. Reduce the worm's length based on the length shown when the HALF bonus is consumed.
Good ;)