diff options
author | momacabu <momacabu@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-11-12 02:46:28 +0000 |
---|---|---|
committer | momacabu <momacabu@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-11-12 02:46:28 +0000 |
commit | a1ad56d8c1e5d07c3dbe3b3d3d54c94650febeaa (patch) | |
tree | 50a71b098f2c89fb28df649f46221c2b2f7499a7 /src/map/atcommand.c | |
parent | 94898ebfcf8ccdae5b064fa27f843136c19e2a65 (diff) | |
download | hercules-a1ad56d8c1e5d07c3dbe3b3d3d54c94650febeaa.tar.gz hercules-a1ad56d8c1e5d07c3dbe3b3d3d54c94650febeaa.tar.bz2 hercules-a1ad56d8c1e5d07c3dbe3b3d3d54c94650febeaa.tar.xz hercules-a1ad56d8c1e5d07c3dbe3b3d3d54c94650febeaa.zip |
Modified @addwarp to accept a new optional parameter <npc name>. If <npc name> is specified, then the warp created will have that name.
Otherwise it will use a name chosen by the emulator.
If there is already another warp with that name the generic name will be used instead.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16919 54d463be-8e91-2dee-dedb-b68131a5f0ec
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; |