summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorglighta <glighta@54d463be-8e91-2dee-dedb-b68131a5f0ec>2013-02-21 06:59:42 +0000
committershennetsind <ind@henn.et>2013-04-11 15:52:04 -0300
commit0e6dcf7291164716aa47940e5967489e13cebfb6 (patch)
treee6bd3418317fefe876dd5a9b29a537c8693d8b04 /src/map/unit.c
parentcafe335b38d41ec3986eedf5ecd156f354ea2c37 (diff)
downloadhercules-0e6dcf7291164716aa47940e5967489e13cebfb6.tar.gz
hercules-0e6dcf7291164716aa47940e5967489e13cebfb6.tar.bz2
hercules-0e6dcf7291164716aa47940e5967489e13cebfb6.tar.xz
hercules-0e6dcf7291164716aa47940e5967489e13cebfb6.zip
-Fix SC__SHADOWFORM not ending if target does not move after being warp. bugreport:7271
-- Thus allowing to inflict damage between map (only if both player don't move). -- Cleanup old map-check on move check. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17148 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index 4732b89dd..798a6ef6f 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -406,7 +406,7 @@ int unit_walktobl(struct block_list *bl, struct block_list *tbl, int range, int
ud = unit_bl2ud(bl);
if( ud == NULL) return 0;
-
+
if (!(status_get_mode(bl)&MD_CANMOVE))
return 0;
@@ -416,13 +416,13 @@ int unit_walktobl(struct block_list *bl, struct block_list *tbl, int range, int
ud->target_to = 0;
return 0;
}
-
+
ud->state.walk_easy = flag&1;
ud->target_to = tbl->id;
ud->chaserange = range; //Note that if flag&2, this SHOULD be attack-range
ud->state.attack_continue = flag&2?1:0; //Chase to attack.
unit_set_target(ud, 0);
-
+
sc = status_get_sc(bl);
if (sc && sc->data[SC_CONFUSION]) //Randomize the target position
map_random_dir(bl, &ud->to_x, &ud->to_y);
@@ -432,7 +432,7 @@ int unit_walktobl(struct block_list *bl, struct block_list *tbl, int range, int
set_mobstate(bl, flag&2);
return 1;
}
-
+
if(DIFF_TICK(ud->canmove_tick, gettick()) > 0)
{ //Can't move, wait a bit before invoking the movement.
add_timer(ud->canmove_tick+1, unit_walktobl_sub, bl->id, ud->target);
@@ -2089,6 +2089,11 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
case BL_PC: {
struct map_session_data *sd = (struct map_session_data*)bl;
+ if(sd->shadowform_id){
+ struct block_list *d_bl = map_id2bl(sd->shadowform_id);
+ if( d_bl )
+ status_change_end(d_bl,SC__SHADOWFORM,INVALID_TIMER);
+ }
//Leave/reject all invitations.
if(sd->chatID)
chat_leavechat(sd,0);