diff options
author | Bardur Arantsson <bardur@scientician.net> | 2016-09-17 09:58:14 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2016-09-17 09:58:14 +0200 |
commit | 013e27d39ee8ee513208d2855c7e3f6252f0c0bf (patch) | |
tree | 78ff86f87247b6bbcc43b14e1c00d10cfaca683f /src/cmd3.cc | |
parent | b15461dbcedf27f28a843f700ce0473d57364230 (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/cmd3.cc')
-rw-r--r-- | src/cmd3.cc | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/cmd3.cc b/src/cmd3.cc index b6f8de28..c333a599 100644 --- a/src/cmd3.cc +++ b/src/cmd3.cc @@ -732,7 +732,7 @@ void do_cmd_uninscribe(void) object_type *o_ptr = get_object(item); /* Nothing to remove */ - if (!o_ptr->note) + if (o_ptr->inscription.empty()) { msg_print("That item had no inscription to remove."); return; @@ -742,7 +742,7 @@ void do_cmd_uninscribe(void) msg_print("Inscription removed."); /* Remove the incription */ - o_ptr->note = 0; + o_ptr->inscription.clear(); /* Combine the pack */ p_ptr->notice |= (PN_COMBINE); @@ -778,22 +778,15 @@ void do_cmd_inscribe(void) msg_format("Inscribing %s.", o_name); msg_print(NULL); - /* Start with nothing */ + /* Start with old inscription */ char out_val[80]; - strcpy(out_val, ""); - - /* Use old inscription */ - if (o_ptr->note) - { - /* Start with the old inscription */ - strcpy(out_val, quark_str(o_ptr->note)); - } + strcpy(out_val, o_ptr->inscription.c_str()); /* Get a new inscription (possibly empty) */ if (get_string("Inscription: ", out_val, sizeof(out_val))) { /* Save the inscription */ - o_ptr->note = quark_add(out_val); + o_ptr->inscription = out_val; /* Combine the pack */ p_ptr->notice |= (PN_COMBINE); |