summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/stuff.h
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/stuff.h')
-rw-r--r--crawl-ref/source/stuff.h5
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();