Allow TSNS and DTEC to detect photons and other energy particles. Set default TSNS radius to 1 to make it easier to avoid detecting the wire connections

This commit is contained in:
Simon Robertshaw 2012-10-10 21:27:36 +01:00
parent da07c22ee4
commit 0b09d2e0f3
3 changed files with 7 additions and 3 deletions

View File

@ -2933,7 +2933,7 @@ int Simulation::create_part(int p, int x, int y, int tv)
case PT_DTEC:
parts[i].tmp2 = 2;
case PT_TSNS:
parts[i].tmp2 = 2;
parts[i].tmp2 = 1;
break;
default:
if (t==PT_FIGH)

View File

@ -84,7 +84,9 @@ int Element_DTEC::update(UPDATE_FUNC_ARGS)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
if(!r)
r = sim->photons[y+ry][x+rx];
if(!r)
continue;
if (parts[r>>8].type == parts[i].ctype && (parts[i].ctype != PT_LIFE || parts[i].tmp == parts[r>>8].tmp))
parts[i].life = 1;

View File

@ -78,7 +78,9 @@ int Element_TSNS::update(UPDATE_FUNC_ARGS)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
if (!r)
if(!r)
r = sim->photons[y+ry][x+rx];
if(!r)
continue;
if (parts[r>>8].temp >= parts[i].temp && parts[r>>8].type != PT_TSNS)
parts[i].life = 1;