summaryrefslogtreecommitdiff
path: root/src/object2.cc
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/object2.cc
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/object2.cc')
-rw-r--r--src/object2.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/object2.cc b/src/object2.cc
index 89378fb2..b4226f76 100644
--- a/src/object2.cc
+++ b/src/object2.cc
@@ -1734,7 +1734,10 @@ bool_ object_similar(object_type const *o_ptr, object_type const *j_ptr)
if ((o_ptr->ident & (IDENT_CURSED)) != (j_ptr->ident & (IDENT_CURSED))) return (0);
/* Hack -- require semi-matching "inscriptions" */
- if (o_ptr->note && j_ptr->note && (o_ptr->note != j_ptr->note)) return (0);
+ if ((!o_ptr->inscription.empty()) && (!j_ptr->inscription.empty()) && (o_ptr->inscription != j_ptr->inscription))
+ {
+ return (0);
+ }
/* Maximal "stacking" limit */
if (total >= MAX_STACK_SIZE) return (0);
@@ -1770,7 +1773,10 @@ void object_absorb(object_type *o_ptr, object_type *j_ptr)
if (j_ptr->ident & (IDENT_MENTAL)) o_ptr->ident |= (IDENT_MENTAL);
/* Hack -- blend "inscriptions" */
- if (j_ptr->note) o_ptr->note = j_ptr->note;
+ if (!j_ptr->inscription.empty())
+ {
+ o_ptr->inscription = j_ptr->inscription;
+ }
/* Hack -- could average discounts XXX XXX XXX */
/* Hack -- save largest discount XXX XXX XXX */