From 6acd227e2734cef1c84e81df5f04318321b67aa1 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 11 Jan 2018 23:16:50 +0100 Subject: [PATCH] fixed a Snake-related bug --- game.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/game.cpp b/game.cpp index 9a12824e..c4edcdc1 100644 --- a/game.cpp +++ b/game.cpp @@ -4558,7 +4558,10 @@ int inpair(cell *c, int colorpair) { } int snake_pair(cell *c) { - return (1 << pattern_threecolor(c)) | (1 << pattern_threecolor(c->mov[c->mondir])); + if(c->mondir == NODIR) + return (1 << pattern_threecolor(c)); + else + return (1 << pattern_threecolor(c)) | (1 << pattern_threecolor(c->mov[c->mondir])); } // note: move from 'c' to 'from'!