diff options
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r-- | src/map/atcommand.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 25fc3182d..5d032c457 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -5259,15 +5259,16 @@ ACMD_FUNC(npcmove) *------------------------------------------*/ ACMD_FUNC(addwarp) { - char mapname[32]; + char mapname[32], warpname[NAME_LENGTH+1]; int x,y; unsigned short m; struct npc_data* nd; nullpo_retr(-1, sd); + memset(warpname, '\0', sizeof(warpname)); - if (!message || !*message || sscanf(message, "%31s %d %d", mapname, &x, &y) < 3) { - clif_displaymessage(fd, msg_txt(1156)); // Usage: @addwarp <mapname> <X> <Y> + if (!message || !*message || sscanf(message, "%31s %d %d %23[^\n]", mapname, &x, &y, warpname) < 3) { + clif_displaymessage(fd, msg_txt(1156)); // Usage: @addwarp <mapname> <X> <Y> {<npc name>} return -1; } @@ -5279,7 +5280,7 @@ ACMD_FUNC(addwarp) return -1; } - nd = npc_add_warp(sd->bl.m, sd->bl.x, sd->bl.y, 2, 2, m, x, y); + nd = npc_add_warp(warpname, sd->bl.m, sd->bl.x, sd->bl.y, 2, 2, m, x, y); if( nd == NULL ) return -1; |