summaryrefslogtreecommitdiff
path: root/src/simulation/elements/PIPE.cpp
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2013-09-08 10:52:44 (GMT)
committer jacksonmj <mj-pt@jacksonmj.co.uk>2013-09-08 10:52:44 (GMT)
commit7270461985cdbc7d07824c9a5a8ae1b0e4eb1229 (patch)
tree4ca432d69aa43f3ad222a0ca864540eb30f740d5 /src/simulation/elements/PIPE.cpp
parent5ad67f7778ede58e9708c43587d694e446a2377b (diff)
downloadpowder-7270461985cdbc7d07824c9a5a8ae1b0e4eb1229.zip
powder-7270461985cdbc7d07824c9a5a8ae1b0e4eb1229.tar.gz
Enabled check for PIPE too
Diffstat (limited to 'src/simulation/elements/PIPE.cpp')
-rw-r--r--src/simulation/elements/PIPE.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/simulation/elements/PIPE.cpp b/src/simulation/elements/PIPE.cpp
index 14dbee0..ee1a21a 100644
--- a/src/simulation/elements/PIPE.cpp
+++ b/src/simulation/elements/PIPE.cpp
@@ -71,6 +71,8 @@ int Element_PIPE::update(UPDATE_FUNC_ARGS)
{
int r, rx, ry, np;
int rnd, rndstore;
+ if ((parts[i].tmp&0xFF)>=PT_NUM || !sim->elements[parts[i].tmp&0xFF].Enabled)
+ parts[i].tmp &= ~0xFF;
if (parts[i].tmp & PPIP_TMPFLAG_TRIGGERS)
{
int pause_changed = 0;
@@ -285,7 +287,7 @@ int Element_PIPE::update(UPDATE_FUNC_ARGS)
//#TPT-Directive ElementHeader Element_PIPE static int graphics(GRAPHICS_FUNC_ARGS)
int Element_PIPE::graphics(GRAPHICS_FUNC_ARGS)
{
- if ((cpart->tmp&0xFF)>0 && (cpart->tmp&0xFF)<PT_NUM)
+ if ((cpart->tmp&0xFF)>0 && (cpart->tmp&0xFF)<PT_NUM && ren->sim->elements[(cpart->tmp&0xFF)].Enabled)
{
//Create a temp. particle and do a subcall.
Particle tpart;