Fixed bug that allowed a specific timing to not receive reflected damage if the origin of the reflect has died, bugreport:4494
Special thanks to xazax! Also: Added a performance improvement: -- Before: all delayed damage would loop through all mobs/players/etc units in the server to confirm that the origin of the damage is equal to the source -- Now: it compares the id of the damage source to the source id. git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15314 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
ce627737db
commit
922e56e099
@ -197,7 +197,9 @@ int battle_delay_damage_sub(int tid, unsigned int tick, int id, intptr_t data)
|
||||
{
|
||||
struct delay_damage *dat = (struct delay_damage *)data;
|
||||
struct block_list *target = map_id2bl(dat->target);
|
||||
if (target && dat && map_id2bl(id) == dat->src && target->prev != NULL && !status_isdead(target) &&
|
||||
|
||||
if ( target && dat && target->prev != NULL && !status_isdead(target) ) {
|
||||
if( id == dat->src->id &&
|
||||
target->m == dat->src->m &&
|
||||
(target->type != BL_PC || ((TBL_PC*)target)->invincible_timer == INVALID_TIMER) &&
|
||||
check_distance_bl(dat->src, target, dat->distance) ) //Check to see if you haven't teleported. [Skotlex]
|
||||
@ -209,6 +211,14 @@ int battle_delay_damage_sub(int tid, unsigned int tick, int id, intptr_t data)
|
||||
if( dat->dmg_lv > ATK_BLOCK && dat->attack_type )
|
||||
skill_counter_additional_effect(dat->src,target,dat->skill_id,dat->skill_lv,dat->attack_type,tick);
|
||||
map_freeblock_unlock();
|
||||
} else if( dat->skill_id == CR_REFLECTSHIELD && !map_id2bl(id) ) {
|
||||
/**
|
||||
* it was monster reflected damage, and the monster died, we pass the damage to the character as expected
|
||||
**/
|
||||
map_freeblock_lock();
|
||||
status_fix_damage(target, target, dat->damage, dat->delay);
|
||||
map_freeblock_unlock();
|
||||
}
|
||||
}
|
||||
ers_free(delay_damage_ers, dat);
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user