summaryrefslogtreecommitdiff
path: root/src/spells2.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2016-10-05 18:45:08 +0200
committerBardur Arantsson <bardur@scientician.net>2016-10-05 18:45:08 +0200
commit7ccb0c1a48d571abd6dc3aca725275e2d264aa2d (patch)
treecf8704730d08eb3567e9de519f768b6f8baae4af /src/spells2.cc
parent667acd0e312301ad613b6a71f843c51d2062aee6 (diff)
Change strings in dungeon_info_type to std::string
Diffstat (limited to 'src/spells2.cc')
-rw-r--r--src/spells2.cc16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/spells2.cc b/src/spells2.cc
index 2540146e..ae7f8aa1 100644
--- a/src/spells2.cc
+++ b/src/spells2.cc
@@ -6089,7 +6089,6 @@ static void print_dungeon_batch(std::vector<int> const &dungeon_idxs,
{
auto const &d_info = game->edit_data.d_info;
- char buf[80];
int i, j;
byte attr;
@@ -6099,7 +6098,9 @@ static void print_dungeon_batch(std::vector<int> const &dungeon_idxs,
{
auto d_ptr = &d_info[dungeon_idxs[j]];
- strnfmt(buf, 80, " %c) %-30s", I2A(i), d_ptr->name);
+ char buf[80];
+ strnfmt(buf, 80, " %c) %-30s", I2A(i), d_ptr->name.c_str());
+
if (mode)
{
if (d_ptr->min_plev > p_ptr->lev)
@@ -6125,11 +6126,6 @@ static int find_dungeon_by_name(char const *name)
/* Find the index corresponding to the name */
for (std::size_t i = 1; i < d_info.size(); i++)
{
- /* Skip non-initialized entries. */
- if (d_info[i].name == nullptr)
- {
- continue;
- }
if (iequals(name, d_info[i].name))
{
return i;
@@ -6208,7 +6204,8 @@ static int reset_recall_aux()
else if (which == '@')
{
char buf[80];
- strcpy(buf, d_info[p_ptr->recall_dungeon].name);
+ strcpy(buf, d_info[p_ptr->recall_dungeon].name.c_str());
+
if (!get_string("Which dungeon? ", buf, 79)) continue;
/* Find the index corresponding to the name */
@@ -6281,8 +6278,9 @@ bool_ reset_recall(bool_ no_trepas_max_depth)
max = d_info[dun].maxdepth;
else
max = max_dlv[dun];
+
depth = get_quantity(format("Which level in %s(%d-%d)? ",
- d_info[dun].name,
+ d_info[dun].name.c_str(),
d_info[dun].mindepth, max),
max);