From b236c75209c45bddf51f6911593d27779dd621e2 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Tue, 18 Dec 2012 14:55:10 -0500 Subject: make TSNS not detect METL, some other sensor and CONV fixes diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 1ac5d48..1e5fbb9 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -2801,24 +2801,22 @@ int Simulation::create_part(int p, int x, int y, int tv) { if (pmap[y][x]) { + int drawOn = pmap[y][x]&0xFF; if (( - ((pmap[y][x]&0xFF)==PT_STOR&&!(elements[t].Properties&TYPE_SOLID))|| - (pmap[y][x]&0xFF)==PT_CLNE|| - (pmap[y][x]&0xFF)==PT_BCLN|| - (pmap[y][x]&0xFF)==PT_CONV|| - ((pmap[y][x]&0xFF)==PT_PCLN&&t!=PT_PSCN&&t!=PT_NSCN)|| - ((pmap[y][x]&0xFF)==PT_PBCN&&t!=PT_PSCN&&t!=PT_NSCN) + (drawOn == PT_STOR && !(elements[t].Properties&TYPE_SOLID)) || + drawOn==PT_CLNE || + drawOn==PT_BCLN || + drawOn==PT_CONV || + (drawOn==PT_PCLN&&t!=PT_PSCN&&t!=PT_NSCN) || + (drawOn==PT_PBCN&&t!=PT_PSCN&&t!=PT_NSCN) )&&( - t!=PT_CLNE&&t!=PT_PCLN&& - t!=PT_BCLN&&t!=PT_STKM&& - t!=PT_STKM2&&t!=PT_PBCN&& - t!=PT_STOR&&t!=PT_FIGH) + t != PT_CLNE && t != PT_PCLN && t != PT_BCLN && t != PT_STKM && t != PT_STKM2 && t != PT_PBCN && t != PT_STOR && t != PT_FIGH && t != PT_CONV) ) { parts[pmap[y][x]>>8].ctype = t; - if (t==PT_LIFE && v>8].tmp = v; + if (t == PT_LIFE && v < NGOLALT && drawOn != PT_STOR) parts[pmap[y][x]>>8].tmp = v; } - else if ((pmap[y][x]&0xFF) == PT_DTEC && (pmap[y][x]&0xFF) != t) + else if (drawOn == PT_DTEC && drawOn != t) { parts[pmap[y][x]>>8].ctype = t; if (t==PT_LIFE && v>8].type; if (sim->parts_avg(i,r>>8,PT_INSL) != PT_INSL) { - if ((sim->elements[rt].Properties&PROP_CONDUCTS) && !(rt==PT_WATR||rt==PT_SLTW||rt==PT_NTCT||rt==PT_PTCT||rt==PT_INWR) && parts[r>>8].life==0 && in_radius(rd, rx, ry)) + if ((sim->elements[rt].Properties&PROP_CONDUCTS) && !(rt==PT_WATR||rt==PT_SLTW||rt==PT_NTCT||rt==PT_PTCT||rt==PT_INWR) && parts[r>>8].life==0) { parts[r>>8].life = 4; parts[r>>8].ctype = rt; diff --git a/src/simulation/elements/TSNS.cpp b/src/simulation/elements/TSNS.cpp index d5c8aa7..a4abbaf 100644 --- a/src/simulation/elements/TSNS.cpp +++ b/src/simulation/elements/TSNS.cpp @@ -64,7 +64,7 @@ int Element_TSNS::update(UPDATE_FUNC_ARGS) rt = parts[r>>8].type; if (sim->parts_avg(i,r>>8,PT_INSL) != PT_INSL) { - if ((sim->elements[rt].Properties&PROP_CONDUCTS) && !(rt==PT_WATR||rt==PT_SLTW||rt==PT_NTCT||rt==PT_PTCT||rt==PT_INWR) && parts[r>>8].life==0 && Element_DTEC::in_radius(rd, rx, ry)) + if ((sim->elements[rt].Properties&PROP_CONDUCTS) && !(rt==PT_WATR||rt==PT_SLTW||rt==PT_NTCT||rt==PT_PTCT||rt==PT_INWR) && parts[r>>8].life==0) { parts[r>>8].life = 4; parts[r>>8].ctype = rt; @@ -82,7 +82,7 @@ int Element_TSNS::update(UPDATE_FUNC_ARGS) r = sim->photons[y+ry][x+rx]; if(!r) continue; - if (parts[r>>8].temp > parts[i].temp && parts[r>>8].type != PT_TSNS) + if (parts[r>>8].temp > parts[i].temp && parts[r>>8].type != PT_TSNS && parts[i].type != PT_METL) parts[i].life = 1; } return 0; -- cgit v0.9.2-21-gd62e