summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index 33be41d5df..e6f79e97c5 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -50,6 +50,7 @@
#include "monstuff.h"
#include "notes.h"
#include "ouch.h"
+#include "overmap.h"
#include "player.h"
#include "shopping.h"
#include "skills.h"
@@ -172,7 +173,7 @@ bool grid_destroys_items( int grid )
return (grid == DNGN_LAVA || grid == DNGN_DEEP_WATER);
}
-// returns 0 is grid is not an altar, else it returns the GOD_* type
+// returns 0 if grid is not an altar, else it returns the GOD_* type
god_type grid_altar_god( unsigned char grid )
{
if (grid >= DNGN_ALTAR_ZIN && grid <= DNGN_ALTAR_ELYVILON)
@@ -181,6 +182,16 @@ god_type grid_altar_god( unsigned char grid )
return (GOD_NO_GOD);
}
+// returns DNGN_FLOOR for non-gods, otherwise returns the altar for
+// the god.
+int altar_for_god( god_type god )
+{
+ if (god == GOD_NO_GOD || god >= NUM_GODS)
+ return (DNGN_FLOOR); // Yeah, lame. Tell me about it.
+
+ return (DNGN_ALTAR_ZIN + god - 1);
+}
+
bool grid_is_branch_stairs( unsigned char grid )
{
return ((grid >= DNGN_ENTER_ORCISH_MINES && grid <= DNGN_ENTER_RESERVED_4)