From 203db57e57532aca5903e07cdd408759ed150fec Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Wed, 28 Sep 2011 23:44:10 +0100 Subject: Prevent segfault with high tmp values for pipe diff --git a/src/elements/pipe.c b/src/elements/pipe.c index 54e3fb6..7411932 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) { -- cgit v0.9.2-21-gd62e