Change pipe and portal to check element type using properties instead of falldown and state

This commit is contained in:
jacksonmj 2012-05-07 14:09:14 +01:00
parent f69920b96c
commit 11bd67eb61
2 changed files with 4 additions and 4 deletions

View File

@ -162,7 +162,7 @@ int update_PIPE(UPDATE_FUNC_ARGS) {
} }
} }
//try eating particle at entrance //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) if ((r&0xFF)==PT_SOAP)
detach(r>>8); detach(r>>8);
@ -173,7 +173,7 @@ int update_PIPE(UPDATE_FUNC_ARGS) {
parts[i].pavg[1] = parts[r>>8].ctype; parts[i].pavg[1] = parts[r>>8].ctype;
kill_part(r>>8); 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].tmp = parts[r>>8].tmp;
parts[i].temp = parts[r>>8].temp; parts[i].temp = parts[r>>8].temp;

View File

@ -39,10 +39,10 @@ int update_PRTI(UPDATE_FUNC_ARGS) {
r = pmap[y+ry][x+rx]; r = pmap[y+ry][x+rx];
if (!r) if (!r)
fe = 1; 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]; 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; continue;
} }