diff options
author | Adam Borowski <kilobyte@angband.pl> | 2011-09-19 12:40:50 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2011-09-19 12:43:20 +0200 |
commit | 44e7ef5f797353e07ffc1e900918a32e9877dc50 (patch) | |
tree | 514a49de0c218594b65a6fcf10f85a620ad23740 /crawl-ref/source/random-var.h | |
parent | a51d98d6c6065e0a5ac6655ea1cfe28c5ef8eb87 (diff) | |
download | crawl-ref-44e7ef5f797353e07ffc1e900918a32e9877dc50.tar.gz crawl-ref-44e7ef5f797353e07ffc1e900918a32e9877dc50.zip |
Implement div_rand_round() for random_var, use it for combat delay.
Two constants divide to the same value no matter the scale, using random_var
was just a waste of CPU. What we want is to allow partial values a percentage
of the time.
Diffstat (limited to 'crawl-ref/source/random-var.h')
-rw-r--r-- | crawl-ref/source/random-var.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crawl-ref/source/random-var.h b/crawl-ref/source/random-var.h index 13c12c612f..351968b91e 100644 --- a/crawl-ref/source/random-var.h +++ b/crawl-ref/source/random-var.h @@ -46,6 +46,7 @@ random_var operator-(const random_var& x, const random_var& y); const random_var& operator+=(random_var& x, const random_var& y); const random_var& operator-=(random_var& x, const random_var& y); random_var operator/(const random_var& x, int d); +random_var div_rand_round(const random_var& x, int d); namespace rv { |