diff options
author | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-12-02 17:26:25 +0000 |
---|---|---|
committer | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-12-02 17:26:25 +0000 |
commit | 493fb3cce76b9b659010b8aeee07916de85cdd5b (patch) | |
tree | d68518e994490d8259fc3b2da3c298bce72f27ca /src/map/atcommand.c | |
parent | 832c4906ccfb62387cce27051202c5a788c87a1a (diff) | |
download | hercules-493fb3cce76b9b659010b8aeee07916de85cdd5b.tar.gz hercules-493fb3cce76b9b659010b8aeee07916de85cdd5b.tar.bz2 hercules-493fb3cce76b9b659010b8aeee07916de85cdd5b.tar.xz hercules-493fb3cce76b9b659010b8aeee07916de85cdd5b.zip |
Fixed @npcmove
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@435 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r-- | src/map/atcommand.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index dfedea102..ce2ffaf08 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -6896,27 +6896,26 @@ atcommand_npcmove(const int fd, struct map_session_data* sd, int x = 0, y = 0; struct npc_data *nd = 0; - if( sd == NULL ) - return -1; + nullpo_retr(-1, sd); if (!message || !*message) return -1; memset(character, '\0', sizeof character); - if (sscanf(message, "%d %d %99[^\n]", &x, &y, character) < 4) + if (sscanf(message, "%d %d %99[^\n]", &x, &y, character) < 3) { + clif_displaymessage(fd, "Usage: @npcmove <X> <Y> <npc_name>"); return -1; + } - nd=npc_name2id(character); - if (nd==NULL) - return -1; + nullpo_retr(-1, (nd = npc_name2id(character))); - npc_enable(character, 0); - nd->bl.x = x; - nd->bl.y = y; - npc_enable(character, 1); + npc_enable(character, 0); + nd->bl.x = x; + nd->bl.y = y; + npc_enable(character, 1); - return 0; + return 0; } /*========================================== |