diff --git a/src/simulation/elements/PIPE.cpp b/src/simulation/elements/PIPE.cpp index 216d3d7ab..2370b054b 100644 --- a/src/simulation/elements/PIPE.cpp +++ b/src/simulation/elements/PIPE.cpp @@ -129,7 +129,7 @@ int Element_PIPE::update(UPDATE_FUNC_ARGS) } } //try eating particle at entrance - else if ((parts[i].tmp&0xFF) == 0 && (sim->elements[r&0xFF].Falldown!= 0 || sim->elements[r&0xFF].State == ST_GAS)) + else if ((parts[i].tmp&0xFF) == 0 && (sim->elements[r&0xFF].Properties & (TYPE_PART | TYPE_LIQUID | TYPE_GAS | TYPE_ENERGY))) { if ((r&0xFF)==PT_SOAP) sim->detach(r>>8); @@ -140,7 +140,7 @@ int Element_PIPE::update(UPDATE_FUNC_ARGS) parts[i].pavg[1] = parts[r>>8].ctype; sim->kill_part(r>>8); } - else if ((parts[i].tmp&0xFF) == 0 && (r&0xFF)==PT_STOR && parts[r>>8].tmp && (sim->elements[parts[r>>8].tmp].Falldown!= 0 || sim->elements[parts[r>>8].tmp].State == ST_GAS)) + else if ((parts[i].tmp&0xFF) == 0 && (r&0xFF)==PT_STOR && parts[r>>8].tmp && (sim->elements[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; @@ -387,4 +387,4 @@ void Element_PIPE::pushParticle(Simulation * sim, int i, int count, int original } -Element_PIPE::~Element_PIPE() {} \ No newline at end of file +Element_PIPE::~Element_PIPE() {} diff --git a/src/simulation/elements/PRTI.cpp b/src/simulation/elements/PRTI.cpp index 4d13bd1fd..451c54bf0 100644 --- a/src/simulation/elements/PRTI.cpp +++ b/src/simulation/elements/PRTI.cpp @@ -63,10 +63,10 @@ int Element_PRTI::update(UPDATE_FUNC_ARGS) r = pmap[y+ry][x+rx]; if (!r) fe = 1; - if (!r || (r&0xFF)==PT_PRTI || (r&0xFF)==PT_PRTO || (sim->elements[r&0xFF].Falldown== 0 && sim->elements[r&0xFF].State != ST_GAS && (r&0xFF)!=PT_SPRK)) + if (!r || (r&0xFF)==PT_PRTI || (r&0xFF)==PT_PRTO || (!(sim->elements[r&0xFF].Properties & (TYPE_PART | TYPE_LIQUID | TYPE_GAS | TYPE_ENERGY)) && (r&0xFF)!=PT_SPRK)) { r = sim->photons[y+ry][x+rx]; - if (!r || (r&0xFF)==PT_PRTI || (r&0xFF)==PT_PRTO || (sim->elements[r&0xFF].Falldown== 0 && sim->elements[r&0xFF].State != ST_GAS && (r&0xFF)!=PT_SPRK)) + if (!r || (r&0xFF)==PT_PRTI || (r&0xFF)==PT_PRTO || (!(sim->elements[r&0xFF].Properties & (TYPE_PART | TYPE_LIQUID | TYPE_GAS | TYPE_ENERGY)) && (r&0xFF)!=PT_SPRK)) continue; } @@ -136,4 +136,4 @@ int Element_PRTI::graphics(GRAPHICS_FUNC_ARGS) } -Element_PRTI::~Element_PRTI() {} \ No newline at end of file +Element_PRTI::~Element_PRTI() {}