From 203db57e57532aca5903e07cdd408759ed150fec Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Wed, 28 Sep 2011 23:44:10 +0100 Subject: [PATCH] Prevent segfault with high tmp values for pipe --- src/elements/pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/elements/pipe.c b/src/elements/pipe.c index 54e3fb6c1..741193259 100644 --- a/src/elements/pipe.c +++ b/src/elements/pipe.c @@ -45,7 +45,7 @@ void pushParticle(int i, int count, int original) } else //predefined 1 pixel thick pipe movement { - int coords = 7 - (parts[i].tmp>>10); + int coords = 7 - ((parts[i].tmp>>10)&7); r = pmap[y+ pos_1_ry[coords]][x+ pos_1_rx[coords]]; if (!r) {