summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-06-01 14:36:22 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-06-01 14:36:22 +0000
commite48d77bc2d05725ebabfc8b314800c1ab808da04 (patch)
tree423f5209d659cb8cff5f87c5f829f5c965a52e49 /src/map/skill.c
parent2729efb32e4eaa5008945061c5dfec77e9d5af85 (diff)
downloadhercules-e48d77bc2d05725ebabfc8b314800c1ab808da04.tar.gz
hercules-e48d77bc2d05725ebabfc8b314800c1ab808da04.tar.bz2
hercules-e48d77bc2d05725ebabfc8b314800c1ab808da04.tar.xz
hercules-e48d77bc2d05725ebabfc8b314800c1ab808da04.zip
Fixed bugreport:208 Warp Portal will cease to function after warping first user if its target is the same point where it was casted.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16205 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index b7cf2a504..dc93a498c 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -9843,7 +9843,8 @@ int skill_castend_map (struct map_session_data *sd, short skill_num, const char
skill_failed(sd);
return 0;
}
-
+
+ group->val1 = (group->val1<<16)|(short)0;
// record the destination coordinates
group->val2 = (x<<16)|y;
group->val3 = mapindex;
@@ -10488,29 +10489,36 @@ static int skill_unit_onplace (struct skill_unit *src, struct block_list *bl, un
sc_start4(bl,type,100,sg->skill_lv,sg->group_id,0,0,sg->limit);
break;
- case UNT_WARP_WAITING:
- if(bl->type==BL_PC){
+ case UNT_WARP_WAITING: {
+ int working = sg->val1&0xffff;
+
+ if(bl->type==BL_PC && !working){
struct map_session_data *sd = (struct map_session_data *)bl;
if((!sd->chatID || battle_config.chat_warpportal)
&& sd->ud.to_x == src->bl.x && sd->ud.to_y == src->bl.y)
{
int x = sg->val2>>16;
int y = sg->val2&0xffff;
+ int count = sg->val1>>16;
unsigned short m = sg->val3;
- if( --sg->val1 <= 0 )
+ if( --count <= 0 )
skill_delunitgroup(sg);
+
+ if ( map_mapindex2mapid(sg->val3) == sd->bl.m && x == sd->bl.x && y == sd->bl.y )
+ working = 1;/* we break it because officials break it, lovely stuff. */
+ sg->val1 = (count<<16)|working;
+
pc_setpos(sd,m,x,y,CLR_TELEPORT);
sg = src->group; // avoid dangling pointer (pc_setpos can cause deletion of 'sg')
}
- } else
- if(bl->type == BL_MOB && battle_config.mob_warp&2)
- {
+ } else if(bl->type == BL_MOB && battle_config.mob_warp&2) {
int m = map_mapindex2mapid(sg->val3);
if (m < 0) break; //Map not available on this map-server.
unit_warp(bl,m,sg->val2>>16,sg->val2&0xffff,CLR_TELEPORT);
}
+ }
break;
case UNT_QUAGMIRE: