From 90cfd1f70f490c11def62d1c01db65b683804f9a Mon Sep 17 00:00:00 2001 From: "Vgr E. Barry" Date: Sat, 21 Apr 2018 12:30:45 -0400 Subject: [PATCH] Add inverted mode for TSNS and PSNS with .tmp == 2 --- src/simulation/elements/PSNS.cpp | 2 +- src/simulation/elements/TSNS.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/simulation/elements/PSNS.cpp b/src/simulation/elements/PSNS.cpp index 8e93988faa..f43166048d 100644 --- a/src/simulation/elements/PSNS.cpp +++ b/src/simulation/elements/PSNS.cpp @@ -48,7 +48,7 @@ Element_PSNS::Element_PSNS() int Element_PSNS::update(UPDATE_FUNC_ARGS) { 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; for (rx = -2; rx <= 2; rx++) diff --git a/src/simulation/elements/TSNS.cpp b/src/simulation/elements/TSNS.cpp index 4fd5709bbb..ce9fd153a4 100644 --- a/src/simulation/elements/TSNS.cpp +++ b/src/simulation/elements/TSNS.cpp @@ -83,7 +83,9 @@ int Element_TSNS::update(UPDATE_FUNC_ARGS) r = sim->photons[y+ry][x+rx]; if (!r) 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; if (parts[i].tmp == 1 && TYP(r) != PT_TSNS && TYP(r) != PT_FILT) {