diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-06-12 19:13:04 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-06-12 19:13:04 (GMT) |
| commit | f8badc05d40703cbdd504cc593715f992a40f1f9 (patch) | |
| tree | 3cee1f1b530e54ba16ccbeacaaf9c7de73f0a48f /src/simulation/Simulation.cpp | |
| parent | 9b8fba4a1912ed74c5471d7f83fd2bace925c213 (diff) | |
| download | powder-f8badc05d40703cbdd504cc593715f992a40f1f9.zip powder-f8badc05d40703cbdd504cc593715f992a40f1f9.tar.gz | |
TPT: Fixed the bug with snow, where it melted without taking it's ctype into account.
Diffstat (limited to 'src/simulation/Simulation.cpp')
| -rw-r--r-- | src/simulation/Simulation.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 00f10d5..acc6671 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -3283,7 +3283,7 @@ void Simulation::update_particles_i(int start, int inc) s = 1; //A fix for ice with ctype = 0 - if (t==PT_ICEI && (parts[i].ctype==0 || parts[i].ctype>=PT_NUM || parts[i].ctype==PT_ICEI)) + if ((t==PT_ICEI || t==PT_SNOW) && (parts[i].ctype==0 || parts[i].ctype>=PT_NUM || parts[i].ctype==PT_ICEI || parts[i].ctype==PT_SNOW)) parts[i].ctype = PT_WATR; if (ctemph>elements[t].HighTemperature&&elements[t].HighTemperatureTransition>-1) { @@ -3307,9 +3307,9 @@ void Simulation::update_particles_i(int start, int inc) if (elements[t].HighTemperatureTransition!=PT_NUM) t = elements[t].HighTemperatureTransition; #endif - else if (t==PT_ICEI) { - if (parts[i].ctype<PT_NUM&&parts[i].ctype!=PT_ICEI) { - if (elements[parts[i].ctype].LowTemperatureTransition==PT_ICEI&&pt<=elements[parts[i].ctype].LowTemperature) s = 0; + else if (t==PT_ICEI || t==PT_SNOW) { + if (parts[i].ctype<PT_NUM&&parts[i].ctype!=t) { + if (elements[parts[i].ctype].LowTemperatureTransition==t&&pt<=elements[parts[i].ctype].LowTemperature) s = 0; else { #ifdef REALISTIC //One ice table value for all it's kinds @@ -3414,7 +3414,7 @@ void Simulation::update_particles_i(int start, int inc) } #endif if (s) { // particle type change occurred - if (t==PT_ICEI||t==PT_LAVA) + if (t==PT_ICEI||t==PT_LAVA||t==PT_SNOW) parts[i].ctype = parts[i].type; if (!(t==PT_ICEI&&parts[i].ctype==PT_FRZW)) parts[i].life = 0; if (elements[t].State==ST_GAS&&elements[parts[i].type].State!=ST_GAS) |
