Add inverted mode for TSNS and PSNS with .tmp == 2

This commit is contained in:
Vgr E. Barry 2018-04-21 12:30:45 -04:00 committed by jacob1
parent 9211fab9f7
commit 90cfd1f70f
2 changed files with 4 additions and 2 deletions

View File

@ -48,7 +48,7 @@ Element_PSNS::Element_PSNS()
int Element_PSNS::update(UPDATE_FUNC_ARGS) int Element_PSNS::update(UPDATE_FUNC_ARGS)
{ {
int r, rx, ry, rt; int r, rx, ry, rt;
if (sim->pv[y/CELL][x/CELL] > parts[i].temp-273.15f) if ((parts[i].tmp == 0 && sim->pv[y/CELL][x/CELL] > parts[i].temp-273.15f) || (parts[i].tmp == 2 && sim->pv[y/CELL][x/CELL] < parts[i].temp-273.15f))
{ {
parts[i].life = 0; parts[i].life = 0;
for (rx = -2; rx <= 2; rx++) for (rx = -2; rx <= 2; rx++)

View File

@ -83,7 +83,9 @@ int Element_TSNS::update(UPDATE_FUNC_ARGS)
r = sim->photons[y+ry][x+rx]; r = sim->photons[y+ry][x+rx];
if (!r) if (!r)
continue; continue;
if (TYP(r) != PT_TSNS && TYP(r) != PT_METL && parts[ID(r)].temp > parts[i].temp) if (parts[i].tmp == 0 && TYP(r) != PT_TSNS && TYP(r) != PT_METL && parts[ID(r)].temp > parts[i].temp)
parts[i].life = 1;
if (parts[i].tmp == 2 && TYP(r) != PT_TSNS && TYP(r) != PT_METL && parts[ID(r)].temp < parts[i].temp)
parts[i].life = 1; parts[i].life = 1;
if (parts[i].tmp == 1 && TYP(r) != PT_TSNS && TYP(r) != PT_FILT) if (parts[i].tmp == 1 && TYP(r) != PT_TSNS && TYP(r) != PT_FILT)
{ {