diff options
| author | jacksonmj <mj-pt@jacksonmj.co.uk> | 2012-05-07 13:09:14 (GMT) |
|---|---|---|
| committer | jacksonmj <mj-pt@jacksonmj.co.uk> | 2012-05-07 13:09:14 (GMT) |
| commit | 11bd67eb6102a137ebd6496e54914a7031d4fc3e (patch) | |
| tree | a426d6ea5ce898367fe230683b42a5f495e55461 /src/elements | |
| parent | f69920b96cda8c46807a1782e40e546c0d434cb3 (diff) | |
| download | powder-11bd67eb6102a137ebd6496e54914a7031d4fc3e.zip powder-11bd67eb6102a137ebd6496e54914a7031d4fc3e.tar.gz | |
Change pipe and portal to check element type using properties instead of falldown and state
Diffstat (limited to 'src/elements')
| -rw-r--r-- | src/elements/pipe.c | 4 | ||||
| -rw-r--r-- | 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 bdafff8..aa6e16b 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 691a7a9..fc6f37b 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; } |
