summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/mods/theme/scpt/misc.lua11
-rw-r--r--src/object1.c18
2 files changed, 18 insertions, 11 deletions
diff --git a/lib/mods/theme/scpt/misc.lua b/lib/mods/theme/scpt/misc.lua
index 17eba40f..a41f9288 100644
--- a/lib/mods/theme/scpt/misc.lua
+++ b/lib/mods/theme/scpt/misc.lua
@@ -54,17 +54,6 @@ end
add_hook_script(HOOK_GIVE, "drunk_takes_wine", "drunk_takes_wine")
--- winged races are allowed soft armor only, no cloaks (from T-Plus)
-function __hook_wings_wear(obj)
- local str = get_race_name()
- local type = obj.tval
- if (str == "Dragon" or str == "Eagle") and (type == 35 or type == 37 or type == 38) then
- return TRUE, -1
- end
-end
-
-add_hook_script(HOOK_WIELD_SLOT, "__hook_wings_wear", "__hook_wings_wear")
-
-- A not-too-scummy way of generating junk for ammo
function food_vessel(object)
if ((object.tval == 80) and (object.sval == 43)) or
diff --git a/src/object1.c b/src/object1.c
index a4676744..63789794 100644
--- a/src/object1.c
+++ b/src/object1.c
@@ -4029,6 +4029,24 @@ s16b wield_slot_ideal(object_type *o_ptr, bool_ ideal)
if (process_hooks_ret(HOOK_WIELD_SLOT, "d", "(O,d)", o_ptr, ideal))
return process_hooks_return[0].num;
+ /* Theme has restrictions for winged races. */
+ if (game_module_idx == MODULE_THEME)
+ {
+ cptr race_name = rp_ptr->title + rp_name;
+
+ if (streq(race_name, "Dragon") ||
+ streq(race_name, "Eagle"))
+ {
+ switch (o_ptr->tval)
+ {
+ case TV_CLOAK:
+ case TV_HARD_ARMOR:
+ case TV_DRAG_ARMOR:
+ return -1;
+ }
+ }
+ }
+
/* Slot for equipment */
switch (o_ptr->tval)
{