diff options
| author | jacksonmj <mj-pt@jacksonmj.co.uk> | 2013-09-05 16:58:46 (GMT) |
|---|---|---|
| committer | jacksonmj <mj-pt@jacksonmj.co.uk> | 2013-09-05 17:06:13 (GMT) |
| commit | 96221ff23e3398fd783557301a5b3b0ede127b42 (patch) | |
| tree | f43b46a6087516fa986ece25a0b17cc9b61215eb /src | |
| parent | 7d9fa1bfc7ae74ed04992a83662dd717d12112d8 (diff) | |
| download | powder-96221ff23e3398fd783557301a5b3b0ede127b42.zip powder-96221ff23e3398fd783557301a5b3b0ede127b42.tar.gz | |
Make effect of PROT on wifi and portals independent of channel temperature ranges
Cold PROT decreases channel by 1, v cold by 10. Hot PROT increases channel by 1, v hot by 10.
Since the effect is specified in terms of effect on channel number not on temperature, this will
cause less problems if the temperature gap is ever decreased to add more channels.
Diffstat (limited to 'src')
| -rw-r--r-- | src/simulation/elements/PROT.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/simulation/elements/PROT.cpp b/src/simulation/elements/PROT.cpp index 133be65..4302244 100644 --- a/src/simulation/elements/PROT.cpp +++ b/src/simulation/elements/PROT.cpp @@ -76,7 +76,20 @@ int Element_PROT::update(UPDATE_FUNC_ARGS) //make temp of other things closer to it's own temperature. This will change temp of things that don't conduct, and won't change the PROT's temperature if (under) { - parts[under>>8].temp -= restrict_flt((parts[under>>8].temp-parts[i].temp)/4.0f, MIN_TEMP, MAX_TEMP); + if ((under&0xFF) == PT_WIFI || (under&0xFF) == PT_PRTI || (under&0xFF) == PT_PRTO) + { + float change; + if (parts[i].temp<173.15f) change = -1000.0f; + else if (parts[i].temp<273.15f) change = -100.0f; + else if (parts[i].temp>473.15f) change = 1000.0f; + else if (parts[i].temp>373.15f) change = 100.0f; + else change = 0.0f; + parts[under>>8].temp = restrict_flt(parts[under>>8].temp+change, MIN_TEMP, MAX_TEMP); + } + else + { + parts[under>>8].temp = restrict_flt(parts[under>>8].temp-(parts[under>>8].temp-parts[i].temp)/4.0f, MIN_TEMP, MAX_TEMP); + } } //else, slowly kill it if it's not inside an element else |
