Commit 65ec002e authored by Iulian Radu's avatar Iulian Radu

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.

https://bugzilla.gnome.org/show_bug.cgi?id=762835
parent 714b627f
......@@ -440,7 +440,7 @@ public class NibblesGame : Object
if (worm.length + worm.change > 2)
{
worm.score += ((worm.length + worm.change / 2) * current_level);
worm.reduce_tail (board, (worm.length + worm.change) / 2);
worm.reduce_tail (board, worm.length / 2);
worm.change -= (worm.length + worm.change) /2;
}
break;
......
......@@ -201,11 +201,6 @@ public class Worm : Object
{
if (erase_size > 0)
{
if (length <= erase_size)
{
reset (board);
}
for (int i = 0; i < erase_size; i++)
{
board[list.last ().x, list.last ().y] = NibblesGame.EMPTYCHAR;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment