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/q_bounty.cc | |
parent | edede30a361f34d8c2f1d5de45adeac9392f41b9 (diff) |
Rework object list filters to avoid global variables
Diffstat (limited to 'src/q_bounty.cc')
-rw-r--r-- | src/q_bounty.cc | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/q_bounty.cc b/src/q_bounty.cc index d8fc63e0..d8042557 100644 --- a/src/q_bounty.cc +++ b/src/q_bounty.cc @@ -65,16 +65,9 @@ static int get_new_bounty_monster(int lev) return r_idx; } -static bool_ bounty_item_tester_hook(object_type *o_ptr) +static bool bounty_item_tester_hook(object_type const *o_ptr) { - if ((o_ptr->tval == TV_CORPSE) && (o_ptr->pval2 == bounty_quest_monster)) - { - return TRUE; - } - else - { - return FALSE; - } + return ((o_ptr->tval == TV_CORPSE) && (o_ptr->pval2 == bounty_quest_monster)); } bool_ quest_bounty_init_hook(int dummy) @@ -114,13 +107,13 @@ bool_ quest_bounty_get_item() } // Get the corpse. - item_tester_hook = bounty_item_tester_hook; int item = -1; bool_ ret = get_item(&item, "What corpse to return?", "You have no corpse to return.", - USE_INVEN); + USE_INVEN, + bounty_item_tester_hook); if (!ret) { return FALSE; } |