diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-03-29 13:39:28 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-03-29 13:39:28 +0000 |
commit | de34ddf0332412f89db35487c8fd6b33cffea28b (patch) | |
tree | 9d2eafe4d48ccdcfc212b313efc33784f8f65591 /crawl-ref/source/stuff.h | |
parent | 2bdb5cf7bc9a6136ded38eca54ae019dcf0c6beb (diff) | |
download | crawl-ref-de34ddf0332412f89db35487c8fd6b33cffea28b.tar.gz crawl-ref-de34ddf0332412f89db35487c8fd6b33cffea28b.zip |
Fixed directionally challenged ball lightning (Ryan Kusnery).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1121 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/stuff.h')
-rw-r--r-- | crawl-ref/source/stuff.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crawl-ref/source/stuff.h b/crawl-ref/source/stuff.h index 9c958361a1..82b8727b7a 100644 --- a/crawl-ref/source/stuff.h +++ b/crawl-ref/source/stuff.h @@ -112,6 +112,11 @@ inline int cap_int(int val, int cap) return (val > cap? cap : val); } +template <typename Z> inline Z sgn(Z x) +{ + return (x < 0? -1 : (x > 0? 1 : 0)); +} + bool is_trap_square(int x, int y); void zap_los_monsters(); |