diff options
author | Neil Moore <neil@s-z.org> | 2014-05-14 18:37:29 -0400 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2014-05-14 18:37:29 -0400 |
commit | 421201469985767f04827adb61886164ad01c2ff (patch) | |
tree | e4858162179b316ed3ea8f5036c3b039be84c8e9 /crawl-ref/source/misc.cc | |
parent | a417c40e72742548630588123da44dad5d4c9bfd (diff) | |
download | crawl-ref-421201469985767f04827adb61886164ad01c2ff.tar.gz crawl-ref-421201469985767f04827adb61886164ad01c2ff.zip |
Remove some hard-coded 1e38s (floatingatoll, Grunt).
And replace them with DBL_MAX, which could theoretically be as low as 1e37.
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r-- | crawl-ref/source/misc.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 1530cbf385..62039ed0de 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -17,6 +17,7 @@ #include <cstdlib> #include <cstdio> #include <cmath> +#include <cfloat> #include "externs.h" #include "misc.h" @@ -1981,7 +1982,7 @@ void bring_to_safety() } coord_def best_pos, pos; - double min_threat = 1e38; + double min_threat = DBL_MAX; int tries = 0; // Up to 100 valid spots, but don't lock up when there's none. This can happen @@ -2022,7 +2023,7 @@ void bring_to_safety() tries += 1000; } - if (min_threat != 1e38) + if (min_threat < DBL_MAX) you.moveto(best_pos); } |