summaryrefslogtreecommitdiff
path: root/src/squelch
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2016-09-17 09:58:14 +0200
committerBardur Arantsson <bardur@scientician.net>2016-09-17 09:58:14 +0200
commit013e27d39ee8ee513208d2855c7e3f6252f0c0bf (patch)
tree78ff86f87247b6bbcc43b14e1c00d10cfaca683f /src/squelch
parentb15461dbcedf27f28a843f700ce0473d57364230 (diff)
Refactor object_type 'inscription' field to std::string
We don't really need quarks for this since we're not nearly as memory-constrained these days.
Diffstat (limited to 'src/squelch')
-rw-r--r--src/squelch/condition.cc6
-rw-r--r--src/squelch/rule.cc6
2 files changed, 4 insertions, 8 deletions
diff --git a/src/squelch/condition.cc b/src/squelch/condition.cc
index 1b58b752..bb598158 100644
--- a/src/squelch/condition.cc
+++ b/src/squelch/condition.cc
@@ -627,12 +627,8 @@ void ClassCondition::to_json(json_t *j) const
bool InscriptionCondition::is_match(object_type *o_ptr) const
{
- if (o_ptr->note == 0)
- {
- return false;
- }
return boost::algorithm::icontains(
- quark_str(o_ptr->note),
+ o_ptr->inscription,
m_inscription);
}
diff --git a/src/squelch/rule.cc b/src/squelch/rule.cc
index 2bdef61b..0f952ebb 100644
--- a/src/squelch/rule.cc
+++ b/src/squelch/rule.cc
@@ -238,7 +238,7 @@ bool DestroyRule::do_apply_rule(object_type *o_ptr, int item_idx) const
}
// Never destroy inscribed items
- if (o_ptr->note)
+ if (!o_ptr->inscription.empty())
{
return false;
}
@@ -317,14 +317,14 @@ void InscribeRule::do_write_tree(TreePrinter *p) const
bool InscribeRule::do_apply_rule(object_type *o_ptr, int) const
{
// Already inscribed?
- if (o_ptr->note != 0)
+ if (!o_ptr->inscription.empty())
{
return false;
}
// Inscribe
msg_format("<Auto-Inscribe {%s}>", m_inscription.c_str());
- o_ptr->note = quark_add(m_inscription.c_str());
+ o_ptr->inscription = m_inscription;
return true;
}