summaryrefslogtreecommitdiff
path: root/src/object_filter.cc
diff options
context:
space:
mode:
authorManoj Srivastava <srivasta@debian.org>2020-05-23 00:33:19 -0700
committerManoj Srivastava <srivasta@debian.org>2020-05-23 00:33:19 -0700
commitd6b913d3ca2e84b75f3675fd6e9f5246c100cf27 (patch)
tree5fc28b7efc737bf2c79dc7d799e0a6013957fe11 /src/object_filter.cc
parentc42f029316c0c004a795ca170bdb50644a800534 (diff)
parent73a0259be1d44fdb2ab34266ae0ff63f0d8f0b60 (diff)
Merge branch 'master' into dgit/siddebian/2.4.0-ah-1archive/debian/2.4.0-ah-1
Diffstat (limited to 'src/object_filter.cc')
-rw-r--r--src/object_filter.cc29
1 files changed, 3 insertions, 26 deletions
diff --git a/src/object_filter.cc b/src/object_filter.cc
index 39961146..936eef7d 100644
--- a/src/object_filter.cc
+++ b/src/object_filter.cc
@@ -17,33 +17,10 @@ object_filter_t SVal(byte sval) {
};
}
-object_filter_t HasFlag3(u32b mask) {
+object_filter_t HasFlags(object_flag_set const &mask) {
return [=](object_type const *o_ptr) -> bool {
- // Extract the flags
- u32b f1, f2, f3, f4, f5, esp;
- object_flags(o_ptr, &f1, &f2, &f3, &f4, &f5, &esp);
- // Does the item have the flag?
- return (f3 & mask);
- };
-}
-
-object_filter_t HasFlag4(u32b mask) {
- return [=](object_type const *o_ptr) -> bool {
- // Extract the flags
- u32b f1, f2, f3, f4, f5, esp;
- object_flags(o_ptr, &f1, &f2, &f3, &f4, &f5, &esp);
- // Does the item have the flag?
- return (f4 & mask);
- };
-}
-
-object_filter_t HasFlag5(u32b mask) {
- return [=](object_type const *o_ptr) -> bool {
- // Extract the flags
- u32b f1, f2, f3, f4, f5, esp;
- object_flags(o_ptr, &f1, &f2, &f3, &f4, &f5, &esp);
- // Does the item have the flag?
- return (f5 & mask);
+ auto const flags = object_flags(o_ptr);
+ return bool(flags & mask);
};
}