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,18 +197,28 @@ int battle_delay_damage_sub(int tid, unsigned int tick, int id, intptr_t data)
|
|||||||
{
|
{
|
||||||
struct delay_damage *dat = (struct delay_damage *)data;
|
struct delay_damage *dat = (struct delay_damage *)data;
|
||||||
struct block_list *target = map_id2bl(dat->target);
|
struct block_list *target = map_id2bl(dat->target);
|
||||||
if (target && dat && map_id2bl(id) == dat->src && target->prev != NULL && !status_isdead(target) &&
|
|
||||||
target->m == dat->src->m &&
|
if ( target && dat && target->prev != NULL && !status_isdead(target) ) {
|
||||||
(target->type != BL_PC || ((TBL_PC*)target)->invincible_timer == INVALID_TIMER) &&
|
if( id == dat->src->id &&
|
||||||
check_distance_bl(dat->src, target, dat->distance)) //Check to see if you haven't teleported. [Skotlex]
|
target->m == dat->src->m &&
|
||||||
{
|
(target->type != BL_PC || ((TBL_PC*)target)->invincible_timer == INVALID_TIMER) &&
|
||||||
map_freeblock_lock();
|
check_distance_bl(dat->src, target, dat->distance) ) //Check to see if you haven't teleported. [Skotlex]
|
||||||
status_fix_damage(dat->src, target, dat->damage, dat->delay);
|
{
|
||||||
if( dat->attack_type && !status_isdead(target) )
|
map_freeblock_lock();
|
||||||
skill_additional_effect(dat->src,target,dat->skill_id,dat->skill_lv,dat->attack_type,dat->dmg_lv,tick);
|
status_fix_damage(dat->src, target, dat->damage, dat->delay);
|
||||||
if( dat->dmg_lv > ATK_BLOCK && dat->attack_type )
|
if( dat->attack_type && !status_isdead(target) )
|
||||||
skill_counter_additional_effect(dat->src,target,dat->skill_id,dat->skill_lv,dat->attack_type,tick);
|
skill_additional_effect(dat->src,target,dat->skill_id,dat->skill_lv,dat->attack_type,dat->dmg_lv,tick);
|
||||||
map_freeblock_unlock();
|
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);
|
ers_free(delay_damage_ers, dat);
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user