summaryrefslogtreecommitdiff
path: root/src/object1.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
commit8bbf783ead4517465445272f9144cf06bdac9be7 (patch)
tree9fa9cc4de0c53df33c557d66a9efbc6781f6fb94 /src/object1.cc
parent013e27d39ee8ee513208d2855c7e3f6252f0c0bf (diff)
Refactor object_type 'artifact name' 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/object1.cc')
-rw-r--r--src/object1.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/object1.cc b/src/object1.cc
index a7c1edf1..b4e1141d 100644
--- a/src/object1.cc
+++ b/src/object1.cc
@@ -717,7 +717,7 @@ void reset_visuals(void)
static void object_flags_xtra(object_type const *o_ptr, object_flag_set *f)
{
// Artifacts don't get *ego* extra powers.
- if (o_ptr->art_name)
+ if (!o_ptr->artifact_name.empty())
{
return;
}
@@ -1126,7 +1126,7 @@ static std::string object_desc_aux(object_type const *o_ptr, int pref, int mode)
else
basenm = aware ? "& # Amulet~" : "& # Amulet~";
- if (known && !o_ptr->art_name && artifact_p(o_ptr))
+ if (known && o_ptr->artifact_name.empty() && artifact_p(o_ptr))
{
basenm = k_ptr->name;
}
@@ -1149,7 +1149,7 @@ static std::string object_desc_aux(object_type const *o_ptr, int pref, int mode)
/* Hack -- The One Ring */
if (!aware && (o_ptr->sval == SV_RING_POWER)) modstr = "Plain Gold";
- if (known && !o_ptr->art_name && artifact_p(o_ptr))
+ if (known && o_ptr->artifact_name.empty() && artifact_p(o_ptr))
{
basenm = k_ptr->name;
}
@@ -1681,10 +1681,10 @@ static std::string object_desc_aux(object_type const *o_ptr, int pref, int mode)
}
/* Is it a new random artifact ? */
- if (o_ptr->art_name)
+ if (!o_ptr->artifact_name.empty())
{
t += ' ';
- t += quark_str(o_ptr->art_name);
+ t += o_ptr->artifact_name;
}
@@ -1848,7 +1848,7 @@ static std::string object_desc_aux(object_type const *o_ptr, int pref, int mode)
else if (o_ptr->to_h)
{
t += fmt::format(" ({:+d}", o_ptr->to_h);
- if (!(flags & TR_HIDE_TYPE) || o_ptr->art_name)
+ if (!(flags & TR_HIDE_TYPE) || (!o_ptr->artifact_name.empty()))
{
t += " to accuracy";
}
@@ -1859,7 +1859,7 @@ static std::string object_desc_aux(object_type const *o_ptr, int pref, int mode)
else if (o_ptr->to_d)
{
t += fmt::format(" ({:+d}", o_ptr->to_d);
- if (!(flags & TR_HIDE_TYPE) || o_ptr->art_name)
+ if (!(flags & TR_HIDE_TYPE) || (!o_ptr->artifact_name.empty()))
{
t += " to damage";
}
@@ -6291,7 +6291,7 @@ bool artifact_p(object_type const *o_ptr)
return
(o_ptr->tval == TV_RANDART) ||
(o_ptr->name1 ? true : false) ||
- (o_ptr->art_name ? true : false) ||
+ (!o_ptr->artifact_name.empty()) ||
((k_info[o_ptr->k_idx].flags & TR_NORM_ART) ? true : false);
}