diff options
author | Bardur Arantsson <bardur@scientician.net> | 2015-04-15 19:12:41 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2015-04-15 19:12:41 +0200 |
commit | 8b2be5adc24ffdecc7bb5d8ed08be12a7590bc46 (patch) | |
tree | 52f137bd6e83baa12ad60b50c4710d04a7559cb2 /src/powers.cc | |
parent | edede30a361f34d8c2f1d5de45adeac9392f41b9 (diff) |
Rework object list filters to avoid global variables
Diffstat (limited to 'src/powers.cc')
-rw-r--r-- | src/powers.cc | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/powers.cc b/src/powers.cc index 0b4f87bc..b5c3841f 100644 --- a/src/powers.cc +++ b/src/powers.cc @@ -587,13 +587,10 @@ static void power_activate(int power) cptr q, s; - /* Restrict choices to monsters */ - item_tester_tval = TV_HYPNOS; - /* Get an item */ q = "Awaken which monster? "; s = "You have no monster to awaken."; - if (!get_item(&item, q, s, (USE_FLOOR))) return; + if (!get_item(&item, q, s, (USE_FLOOR), object_filter::TVal(TV_HYPNOS))) return; o_ptr = &o_list[0 - item]; @@ -878,12 +875,10 @@ static void power_activate(int power) object_type * o_ptr; int lev, item; - item_tester_hook = item_tester_hook_recharge; - /* Get an item */ q = "Drain which item? "; s = "You have nothing to drain."; - if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) break; + if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR), item_tester_hook_recharge())) break; o_ptr = get_object(item); |