summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-10-20 14:11:16 -0700
committerBen Longbons <b.r.longbons@gmail.com>2013-10-20 14:11:23 -0700
commit48a120d6c5c6e862631bce33c8060bb7b2f858b3 (patch)
tree041b1fec87c073a936f2011c45656071f9586310 /src/map
parent2533cfb000ccf46174edd4cf9d99b19768e6fb00 (diff)
downloadtmwa-48a120d6c5c6e862631bce33c8060bb7b2f858b3.tar.gz
tmwa-48a120d6c5c6e862631bce33c8060bb7b2f858b3.tar.bz2
tmwa-48a120d6c5c6e862631bce33c8060bb7b2f858b3.tar.xz
tmwa-48a120d6c5c6e862631bce33c8060bb7b2f858b3.zip
Fix crash on synthetic init gm commands
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp
index abfe0d4..75c46a2 100644
--- a/src/map/atcommand.cpp
+++ b/src/map/atcommand.cpp
@@ -173,9 +173,12 @@ void log_atcommand(dumb_ptr<map_session_data> sd, ZString cmd)
return;
timestamp_seconds_buffer tmpstr;
stamp_time(tmpstr);
+ MapName map = (sd->bl_m
+ ? sd->bl_m->name_
+ : stringish<MapName>("undefined.gat"));
FPRINTF(fp, "[%s] %s(%d,%d) %s(%d) : %s\n",
tmpstr,
- sd->bl_m->name_, sd->bl_x, sd->bl_y,
+ map, sd->bl_x, sd->bl_y,
sd->status.name, sd->status.account_id,
cmd);
fflush(fp);