-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://svn.code.sf.net/p/rathena/svn/trunk@17148 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
0ec8a5b6c5
commit
085fe52dbc
@ -1147,7 +1147,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
|
|||||||
|
|
||||||
if( sc && sc->data[SC__SHADOWFORM] ) {
|
if( sc && sc->data[SC__SHADOWFORM] ) {
|
||||||
struct block_list *s_bl = map_id2bl(sc->data[SC__SHADOWFORM]->val2);
|
struct block_list *s_bl = map_id2bl(sc->data[SC__SHADOWFORM]->val2);
|
||||||
if( !s_bl ) { // If the shadow form target is not present remove the sc.
|
if( !s_bl || s_bl->m != bl->m ) { // If the shadow form target is not present remove the sc.
|
||||||
status_change_end(bl, SC__SHADOWFORM, INVALID_TIMER);
|
status_change_end(bl, SC__SHADOWFORM, INVALID_TIMER);
|
||||||
} else if( status_isdead(s_bl) || !battle_check_target(src,s_bl,BCT_ENEMY)) { // If the shadow form target is dead or not your enemy remove the sc in both.
|
} else if( status_isdead(s_bl) || !battle_check_target(src,s_bl,BCT_ENEMY)) { // If the shadow form target is dead or not your enemy remove the sc in both.
|
||||||
status_change_end(bl, SC__SHADOWFORM, INVALID_TIMER);
|
status_change_end(bl, SC__SHADOWFORM, INVALID_TIMER);
|
||||||
|
@ -415,7 +415,7 @@ int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick)
|
|||||||
|
|
||||||
if( bl->type == BL_PC && ((TBL_PC*)bl)->shadowform_id ) {//Shadow Form Target Moving
|
if( bl->type == BL_PC && ((TBL_PC*)bl)->shadowform_id ) {//Shadow Form Target Moving
|
||||||
struct block_list *d_bl;
|
struct block_list *d_bl;
|
||||||
if( (d_bl = map_id2bl(((TBL_PC*)bl)->shadowform_id)) == NULL || bl->m != d_bl->m || !check_distance_bl(bl,d_bl,10) ) {
|
if( (d_bl = map_id2bl(((TBL_PC*)bl)->shadowform_id)) == NULL || !check_distance_bl(bl,d_bl,10) ) {
|
||||||
if( d_bl )
|
if( d_bl )
|
||||||
status_change_end(d_bl,SC__SHADOWFORM,INVALID_TIMER);
|
status_change_end(d_bl,SC__SHADOWFORM,INVALID_TIMER);
|
||||||
((TBL_PC*)bl)->shadowform_id = 0;
|
((TBL_PC*)bl)->shadowform_id = 0;
|
||||||
@ -440,7 +440,7 @@ int map_moveblock(struct block_list *bl, int x1, int y1, unsigned int tick)
|
|||||||
|
|
||||||
if( sc->data[SC__SHADOWFORM] ) {//Shadow Form Caster Moving
|
if( sc->data[SC__SHADOWFORM] ) {//Shadow Form Caster Moving
|
||||||
struct block_list *d_bl;
|
struct block_list *d_bl;
|
||||||
if( (d_bl = map_id2bl(sc->data[SC__SHADOWFORM]->val2)) == NULL || bl->m != d_bl->m || !check_distance_bl(bl,d_bl,10) )
|
if( (d_bl = map_id2bl(sc->data[SC__SHADOWFORM]->val2)) == NULL || !check_distance_bl(bl,d_bl,10) )
|
||||||
status_change_end(bl,SC__SHADOWFORM,INVALID_TIMER);
|
status_change_end(bl,SC__SHADOWFORM,INVALID_TIMER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2085,6 +2085,11 @@ int unit_remove_map_(struct block_list *bl, clr_type clrtype, const char* file,
|
|||||||
case BL_PC: {
|
case BL_PC: {
|
||||||
struct map_session_data *sd = (struct map_session_data*)bl;
|
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.
|
//Leave/reject all invitations.
|
||||||
if(sd->chatID)
|
if(sd->chatID)
|
||||||
chat_leavechat(sd,0);
|
chat_leavechat(sd,0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user