From 5e59d3abbd6547ff48a2571cdc77b29ab1326c04 Mon Sep 17 00:00:00 2001 From: momacabu Date: Tue, 13 Nov 2012 00:27:40 +0000 Subject: - Fixed bugreport:6887, a variable was not initialized; - Make @addwarp 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 --- conf/msg_athena.conf | 2 +- doc/atcommands.txt | 10 +++++----- src/map/atcommand.c | 4 ++-- src/map/npc.c | 11 ++++------- src/map/skill.c | 2 +- src/map/status.c | 2 +- 6 files changed, 14 insertions(+), 17 deletions(-) diff --git a/conf/msg_athena.conf b/conf/msg_athena.conf index 828822280..f4fab7116 100644 --- a/conf/msg_athena.conf +++ b/conf/msg_athena.conf @@ -984,7 +984,7 @@ 1155: NPC moved. // @addwarp -1156: Usage: @addwarp {} +1156: Usage: @addwarp 1157: Unknown map '%s'. 1158: New warp NPC '%s' created. diff --git a/doc/atcommands.txt b/doc/atcommands.txt index d53fab203..e472c9908 100644 --- a/doc/atcommands.txt +++ b/doc/atcommands.txt @@ -190,17 +190,17 @@ Sets a mapflag for the current map (1 = On, 0 = Off). --------------------------------------- -@addwarp {} +@addwarp Creates a warp portal on the character's current coordinates that lasts until the next reboot. -If no name is specified, the server will automatically assign a name for the warp portal. -The name will be displayed only once in the chat window. +The name parameter is mandatory and if it already exists, the server will automagically assign a name, +and it will be displayed only once in the chat window. Example: -@addwarp prontera 50 50 +@addwarp prontera 50 50 my_warp_sample Output: -New warp NPC 'warp_4_170_198' created. +New warp NPC 'my_warp_sample' created. --------------------------------------- diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 5d032c457..5be76d36a 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -5267,8 +5267,8 @@ ACMD_FUNC(addwarp) nullpo_retr(-1, sd); memset(warpname, '\0', sizeof(warpname)); - if (!message || !*message || sscanf(message, "%31s %d %d %23[^\n]", mapname, &x, &y, warpname) < 3) { - clif_displaymessage(fd, msg_txt(1156)); // Usage: @addwarp {} + if (!message || !*message || sscanf(message, "%31s %d %d %23[^\n]", mapname, &x, &y, warpname) < 4) { + clif_displaymessage(fd, msg_txt(1156)); // Usage: @addwarp return -1; } 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 ) diff --git a/src/map/skill.c b/src/map/skill.c index 5d03b739a..c01da31d5 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -4692,7 +4692,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in return skill_castend_damage_id (src, bl, skillid, skilllv, tick, flag); case MH_STEINWAND: { struct block_list *s_src = battle_get_master(src); - short ret; + short ret = 0; if(!skill_check_unit_range(src, src->x, src->y, skillid, skilllv)) //prevent reiteration ret = skill_castend_pos2(src,src->x,src->y,skillid,skilllv,tick,flag); //cast on homon if(s_src && !skill_check_unit_range(s_src, s_src->x, s_src->y, skillid, skilllv)) diff --git a/src/map/status.c b/src/map/status.c index 68b7498fc..3df88e823 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -9419,7 +9419,7 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const clif_status_load(bl, SI_ACTIVE_MONSTER_TRANSFORM, 0); break; case SC_INTRAVISION: - calc_flag = SCB_ALL;/* required for overlapping */ + calc_flag = SCB_BASE;/* required for overlapping */ break; } -- cgit v1.2.3-60-g2f50