summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-04-10 21:59:44 +0200
committerBardur Arantsson <bardur@scientician.net>2012-04-10 21:59:44 +0200
commit5a310053e1ed6331155e4c4a3a645291c0a95650 (patch)
treeb949f72655dd2056f90995c1a2625b2be5c711de /src
parentbc2f31566512bc0c41aa3ab5b19ce3e907b6c0cf (diff)
Lua: Gods: Move Varda's HOOK_CALC_LITE to C
Diffstat (limited to 'src')
-rw-r--r--src/defines.h1
-rw-r--r--src/util.pkg6
-rw-r--r--src/xtra1.c16
3 files changed, 14 insertions, 9 deletions
diff --git a/src/defines.h b/src/defines.h
index 2375c852..92d7fa10 100644
--- a/src/defines.h
+++ b/src/defines.h
@@ -4545,7 +4545,6 @@
#define HOOK_APPLY_MAGIC 66
#define HOOK_PLAYER_EXP 67
#define HOOK_BIRTH 68
-#define HOOK_CALC_LITE 69
#define HOOK_LEARN_ABILITY 70
#define HOOK_MOVED 71
#define HOOK_GAME_START 72
diff --git a/src/util.pkg b/src/util.pkg
index f9c94966..3e977785 100644
--- a/src/util.pkg
+++ b/src/util.pkg
@@ -760,12 +760,6 @@ typedef unsigned int u32b;
*/
#define HOOK_BIRTH 68
-/** @def HOOK_CALC_LITE
- * @brief Calculate the lite radius.
- * @note (see file xtra1.c)
- */
-#define HOOK_CALC_LITE 69
-
/** @def HOOK_LEARN_ABILITY
* @brief Player learns an ability.\n
* @param Number ab \n index of ability in ability (ab_info) array.
diff --git a/src/xtra1.c b/src/xtra1.c
index c1189484..a2f64d0e 100644
--- a/src/xtra1.c
+++ b/src/xtra1.c
@@ -1969,6 +1969,18 @@ void calc_hitpoints(void)
}
+/*
+ * God hooks for light
+ */
+static void calc_torch_gods()
+{
+ if (p_ptr->pgod == GOD_VARDA)
+ {
+ /* increase lite radius */
+ p_ptr->cur_lite += 1;
+ }
+}
+
/*
* Extract and set the current "lite radius"
@@ -2018,8 +2030,8 @@ static void calc_torch(void)
/* but does glow as an intrinsic. */
if (p_ptr->cur_lite == 0 && p_ptr->lite) p_ptr->cur_lite = 1;
- /* Hooked powers */
- process_hooks(HOOK_CALC_LITE, "()");
+ /* gods */
+ calc_torch_gods();
/* end experimental mods */