summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2011-10-18 14:10:25 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-10-19 09:47:39 (GMT)
commit9fed467a28003c2e0a6055bc9db29d26d06fb5b3 (patch)
treeb7c3ea7bdd1be362ecb843349f4fdfefe3ca238b /src
parent7d9d504abfaaf132d831edd23bb225d346f619c8 (diff)
downloadpowder-9fed467a28003c2e0a6055bc9db29d26d06fb5b3.zip
powder-9fed467a28003c2e0a6055bc9db29d26d06fb5b3.tar.gz
Fix infinite temperatures
May also need -fno-finite-math-only, but it works fine for me without it
Diffstat (limited to 'src')
-rw-r--r--src/powder.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/powder.c b/src/powder.c
index a427acc..1851f45 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -1826,8 +1826,9 @@ void update_particles_i(pixel *vid, int start, int inc)
pt = (c_heat+parts[i].temp*96.645/ptypes[t].hconduct*fabs(ptypes[t].weight))/(c_Cm+96.645/ptypes[t].hconduct*fabs(ptypes[t].weight));
#else
- pt = parts[i].temp = (c_heat+parts[i].temp)/(h_count+1);
+ pt = (c_heat+parts[i].temp)/(h_count+1);
#endif
+ pt = parts[i].temp = restrict_flt(pt, MIN_TEMP, MAX_TEMP);
for (j=0; j<8; j++)
{
parts[surround_hconduct[j]].temp = pt;