Jump to content

  •  

Bug Tracker Migration

June 3rd
Good news everyone! The staff has decided that it is time to slowly kill off this Bug Tracker. We will begin the process of slowly migrating from this Bug Tracker over to our Github Issues which can be found here: https://github.com/HerculesWS/Hercules/issues

Over the next couple of days, I will be closing off any opportunity to create new reports. However, I still will keep the opportunity to reply to existing Bug Reports. Doing this will allow us to slowly fix any bug reports we have listed here so that we can easily migrate over to our Issue Tracker.

Update - June 7th 2015: Creating new bug posts has been disabled. Please use our https://github.com/HerculesWS/Hercules/issues tracker to post bugs. Users are still able to reply to existing bug posts.

- Administration

Issue Information

Issue Confirmations

  • Yes (0)No (0)
Photo

Reflected dmg issue - race condition

Posted by Hercules Bot on 21 October 2010 - 06:26 PM

Originally posted by Kazukin
http://www.eathena.w...er&showbug=4494

When a monster is killed under SC_REFLECTSHIELD or any other statuses capable of making a monster to reflect damage, the blow which killed such monster and the reflected damage are under a race condition which can lead to 2 different outputs:

  1. If battle_delay_damage_sub() is executed first with the reflected dmg, all is alright, last blow dmg is reflected back to the source and the monster is killed by a second call to battle_delay_damage_sub() with the blow's dmg.

  2. If battle_delay_damage_sub() is executed first with the blow's dmg, unit is cleared and when battle_delay_damage_sub() is executed with the reflected dmg, these conditions make it fail, so dmg is never reflected back to the source:

  (map_id2bl(id) == dat->src)

  check_distance_bl(dat->src, target, dat->distance)

  Where src is the killed monster.

  This behavior can be observed pretty clearly when killing a Golden Thief Bug under SC_REFLECTSHIELD with Asura. There are times when you die by the reflected dmg, and there are times when even if the reflected dmg is shown, you don't receive any dmg at all.

This post has been edited by Kazukin: Jul 7 2011, 07:47 PM

Originally posted by Arcadia
Hello any fix on this ?

Originally posted by Ind
Developers: I've found a concerning issue while trying to fix this. in battle_delay_damage_sub I've added the following debug line
    if( target && dat->src && dat->skill_id == CR_REFLECTSHIELD )
        ShowDebug("A: %d ( %d,%d vs %d,%d ) | %d | %d\n",distance_bl(dat->src, target),target->x,target->y,dat->src->x,dat->src->y,status_isdead(target)?1:0,status_isdead(dat->src)?1:0);
and whenever I successfully reproduced the bug (damn, there were times when i had to spawn over 10 gtb to get there), I'd get this:
A: 634 ( 56,119 vs -515,-515 ) | 0 | 0
Looks like we're with a memory problem somewhere, that is what causes this bug (and maybe even more)

Originally posted by Ind
Fixed in [rev=15314]