From 9fed467a28003c2e0a6055bc9db29d26d06fb5b3 Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Tue, 18 Oct 2011 22:10:25 +0800 Subject: [PATCH] Fix infinite temperatures May also need -fno-finite-math-only, but it works fine for me without it --- src/powder.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/powder.c b/src/powder.c index a427acc22..1851f45a7 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;