From 11bd67eb6102a137ebd6496e54914a7031d4fc3e Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Mon, 7 May 2012 14:09:14 +0100 Subject: [PATCH] Change pipe and portal to check element type using properties instead of falldown and state --- src/elements/pipe.c | 4 ++-- src/elements/prti.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/elements/pipe.c b/src/elements/pipe.c index bdafff8d3..aa6e16bc5 100644 --- a/src/elements/pipe.c +++ b/src/elements/pipe.c @@ -162,7 +162,7 @@ int update_PIPE(UPDATE_FUNC_ARGS) { } } //try eating particle at entrance - else if ((parts[i].tmp&0xFF) == 0 && (ptypes[r&0xFF].falldown!= 0 || ptypes[r&0xFF].state == ST_GAS)) + else if ((parts[i].tmp&0xFF) == 0 && (ptypes[r&0xFF].properties & (TYPE_PART | TYPE_LIQUID | TYPE_GAS | TYPE_ENERGY))) { if ((r&0xFF)==PT_SOAP) detach(r>>8); @@ -173,7 +173,7 @@ int update_PIPE(UPDATE_FUNC_ARGS) { parts[i].pavg[1] = parts[r>>8].ctype; kill_part(r>>8); } - else if ((parts[i].tmp&0xFF) == 0 && (r&0xFF)==PT_STOR && parts[r>>8].tmp && (ptypes[parts[r>>8].tmp].falldown!= 0 || ptypes[parts[r>>8].tmp].state == ST_GAS)) + else if ((parts[i].tmp&0xFF) == 0 && (r&0xFF)==PT_STOR && parts[r>>8].tmp && (ptypes[parts[r>>8].tmp].properties & (TYPE_PART | TYPE_LIQUID | TYPE_GAS | TYPE_ENERGY))) { parts[i].tmp = parts[r>>8].tmp; parts[i].temp = parts[r>>8].temp; diff --git a/src/elements/prti.c b/src/elements/prti.c index 691a7a929..fc6f37ba4 100644 --- a/src/elements/prti.c +++ b/src/elements/prti.c @@ -39,10 +39,10 @@ int update_PRTI(UPDATE_FUNC_ARGS) { r = pmap[y+ry][x+rx]; if (!r) fe = 1; - if (!r || (r&0xFF)==PT_PRTI || (r&0xFF)==PT_PRTO || (ptypes[r&0xFF].falldown== 0 && ptypes[r&0xFF].state != ST_GAS && (r&0xFF)!=PT_SPRK)) + if (!r || (r&0xFF)==PT_PRTI || (r&0xFF)==PT_PRTO || (!(ptypes[r&0xFF].properties & (TYPE_PART | TYPE_LIQUID | TYPE_GAS | TYPE_ENERGY)) && (r&0xFF)!=PT_SPRK)) { r = photons[y+ry][x+rx]; - if (!r || (r&0xFF)==PT_PRTI || (r&0xFF)==PT_PRTO || (ptypes[r&0xFF].falldown== 0 && ptypes[r&0xFF].state != ST_GAS && (r&0xFF)!=PT_SPRK)) + if (!r || (r&0xFF)==PT_PRTI || (r&0xFF)==PT_PRTO || (!(ptypes[r&0xFF].properties & (TYPE_PART | TYPE_LIQUID | TYPE_GAS | TYPE_ENERGY)) && (r&0xFF)!=PT_SPRK)) continue; }