diff options
author | cookiecrumbs <cookiecrumbs@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-07-22 22:36:13 +0000 |
---|---|---|
committer | cookiecrumbs <cookiecrumbs@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-07-22 22:36:13 +0000 |
commit | 740f7131f70e75c76c41d0449eda16188655ee3e (patch) | |
tree | dcdba39b86db98122855d443e5dd2f627a71d37e /src/map/battle.c | |
parent | 8e49babe962cc73a8fee01ac0c7b4e759ff3ff84 (diff) | |
download | hercules-740f7131f70e75c76c41d0449eda16188655ee3e.tar.gz hercules-740f7131f70e75c76c41d0449eda16188655ee3e.tar.bz2 hercules-740f7131f70e75c76c41d0449eda16188655ee3e.tar.xz hercules-740f7131f70e75c76c41d0449eda16188655ee3e.zip |
Added a check on the battle_delay_damage_sub to prevent crashes from map_freeblock_lock/unlock issues and the pointer becoming dereferenced. Original fix suggested by WildCard and it has proven to resolve issues on a larger scale server. bugreport:6123
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16476 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r-- | src/map/battle.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index e0659ce81..a9c8ba6ea 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -200,7 +200,7 @@ int battle_delay_damage_sub(int tid, unsigned int tick, int id, intptr_t data) { struct delay_damage *dat = (struct delay_damage *)data; - if ( dat && dat->target && dat->target->prev != NULL && !status_isdead(dat->target) ) { + if ( dat && dat->target && map_id2bl(id) == dat->src && dat->target->prev != NULL && !status_isdead(dat->target) ) { if( dat->src && dat->src->prev != NULL && id == dat->src->id && dat->target->m == dat->src->m && (dat->target->type != BL_PC || ((TBL_PC*)dat->target)->invincible_timer == INVALID_TIMER) && |