TPT: Change pipe and portal to check element type using properties instead of falldown and state 11bd67eb61

This commit is contained in:
Simon Robertshaw 2012-06-12 17:31:32 +01:00
parent 20e85066dc
commit 6af88ee7da
2 changed files with 6 additions and 6 deletions

View File

@ -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() {}
Element_PIPE::~Element_PIPE() {}

View File

@ -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() {}
Element_PRTI::~Element_PRTI() {}