diff options
author | momacabu <momacabu@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-11-13 00:27:40 +0000 |
---|---|---|
committer | momacabu <momacabu@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-11-13 00:27:40 +0000 |
commit | 5e59d3abbd6547ff48a2571cdc77b29ab1326c04 (patch) | |
tree | a5d44d71aeac27ed75eebca5f27ff99b7a89889b /src/map/npc.c | |
parent | 4cc80656aeb5af0e810a5f7c1ef28624b1328dbd (diff) | |
download | hercules-5e59d3abbd6547ff48a2571cdc77b29ab1326c04.tar.gz hercules-5e59d3abbd6547ff48a2571cdc77b29ab1326c04.tar.bz2 hercules-5e59d3abbd6547ff48a2571cdc77b29ab1326c04.tar.xz hercules-5e59d3abbd6547ff48a2571cdc77b29ab1326c04.zip |
- Fixed bugreport:6887, a variable was not initialized;
- Make @addwarp <npc name> parameter mandatory as per requests;
- Changed SCB_ALL to SCB_BASE on SC_INTRAVISION case, it should be enough.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16922 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.c')
-rw-r--r-- | src/map/npc.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/map/npc.c b/src/map/npc.c index 0ed3dd68b..f3a939c2c 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -2021,14 +2021,11 @@ struct npc_data* npc_add_warp(char* name, short from_mapid, short from_x, short nd->bl.x = from_x; nd->bl.y = from_y; - if (name) - { - safestrncpy(nd->exname, name, ARRAYLENGTH(nd->exname)); - if (npc_name2id(nd->exname) != NULL) - flag = 1; - } + safestrncpy(nd->exname, name, ARRAYLENGTH(nd->exname)); + if (npc_name2id(nd->exname) != NULL) + flag = 1; - if (name[0] == '\0' || flag == 1) + if (flag == 1) snprintf(nd->exname, ARRAYLENGTH(nd->exname), "warp_%d_%d_%d", from_mapid, from_x, from_y); for( i = 0; npc_name2id(nd->exname) != NULL; ++i ) |