summaryrefslogtreecommitdiff
path: root/src/map/atcommand.cpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-04-15 20:05:17 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-04-19 20:09:35 -0700
commitceeda2e337077b2edaf1af09cc4df2c30e8205a1 (patch)
treeab7a70020e1dcac9ee56531c1c5af9888989f4f3 /src/map/atcommand.cpp
parent147c3e9c891c12dbfd39b65ee0f5baddf5f81b14 (diff)
downloadtmwa-ceeda2e337077b2edaf1af09cc4df2c30e8205a1.tar.gz
tmwa-ceeda2e337077b2edaf1af09cc4df2c30e8205a1.tar.bz2
tmwa-ceeda2e337077b2edaf1af09cc4df2c30e8205a1.tar.xz
tmwa-ceeda2e337077b2edaf1af09cc4df2c30e8205a1.zip
Wouldn't it be nice to have some integers too?
Diffstat (limited to 'src/map/atcommand.cpp')
-rw-r--r--src/map/atcommand.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp
index f721aaa..c76c34c 100644
--- a/src/map/atcommand.cpp
+++ b/src/map/atcommand.cpp
@@ -130,7 +130,7 @@ void atcommand_config_write(ZString cfgName)
{
// This XString is really a ZString, but not declared as one
// in order to allow non-heterogenous lookup by XString.
- const char *cmd = &*pair.first.begin();
+ auto cmd = ZString(strings::really_construct_from_a_pointer, &*pair.first.begin(), nullptr);
const AtCommandInfo& info = pair.second;
FPRINTF(out,
@@ -389,7 +389,7 @@ bool atcommand_config_read(ZString cfgName)
/// @ command processing functions
static
-void atc_do_help(Session *s, const char *cmd, const AtCommandInfo& info)
+void atc_do_help(Session *s, ZString cmd, const AtCommandInfo& info)
{
auto msg = STRPRINTF("\u2007\u2007%d: @%s %s"_fmt, info.level, cmd, info.args);
// manually padding because *space*
@@ -429,7 +429,7 @@ ATCE atcommand_help(Session *s, dumb_ptr<map_session_data>,
clif_displaymessage(s, "Synopses of GM commands in category 'all':"_s);
for (const auto& pair : atcommand_info)
{
- const char *cmd = &*pair.first.begin();
+ auto cmd = ZString(strings::really_construct_from_a_pointer, &*pair.first.begin(), nullptr);
const AtCommandInfo& info = pair.second;
atc_do_help(s, cmd, info);
}
@@ -447,7 +447,7 @@ ATCE atcommand_help(Session *s, dumb_ptr<map_session_data>,
clif_displaymessage(s, STRPRINTF("Synopses of GM commands in level [%d, %d):"_fmt, low, high));
for (const auto& pair : atcommand_info)
{
- const char *cmd = &*pair.first.begin();
+ auto cmd = ZString(strings::really_construct_from_a_pointer, &*pair.first.begin(), nullptr);
const AtCommandInfo& info = pair.second;
if (low <= info.level && info.level < high)
atc_do_help(s, cmd, info);