From a36dcfd0acffc1a656bd0cdaede8024d957faaac Mon Sep 17 00:00:00 2001 From: skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> Date: Thu, 30 Mar 2006 21:04:17 +0000 Subject: [PATCH] - Added a missing "return 0" that fixes a crash on failed lookups on status_change_timer git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5818 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 2 ++ src/map/battle.c | 6 +++--- src/map/status.c | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index d84907edba..7f38559268 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,8 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. 2006/03/30 + * Added a missing return that fixes crashes on status_change_timer when + source is not found. [Skotlex] * Added year day return in gettime function. gettime(8) returns 1~366 [Foruken] * the auth function in login.c won't jstrescapecpy passwords that were diff --git a/src/map/battle.c b/src/map/battle.c index 479a2c0e11..0bf75eb2d2 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -165,7 +165,7 @@ int battle_damage(struct block_list *src,struct block_list *target,int damage, i struct map_session_data *sd = NULL; struct status_change *sc; - nullpo_retr(0, target); //stc��NULL�ŌĂ�邱�Ƃ�����̂ő��Ń`�F�b�N + nullpo_retr(0, target); //src��NULL�ŌĂ�邱�Ƃ�����̂ő��Ń`�F�b�N sc = status_get_sc(target); @@ -2175,8 +2175,8 @@ static struct Damage battle_calc_weapon_attack( { if(wd.damage2<1) { wd.damage=battle_calc_damage(src,target,wd.damage,wd.div_,skill_num,skill_lv,wd.flag); - if (map_flag_gvg(target->m)) - wd.damage=battle_calc_gvg_damage(src,target,wd.damage,wd.div_,skill_num,skill_lv,wd.flag); + if (map_flag_gvg(target->m)) + wd.damage=battle_calc_gvg_damage(src,target,wd.damage,wd.div_,skill_num,skill_lv,wd.flag); } else if(wd.damage<1) { wd.damage2=battle_calc_damage(src,target,wd.damage2,wd.div_,skill_num,skill_lv,wd.flag); if (map_flag_gvg(target->m)) diff --git a/src/map/status.c b/src/map/status.c index 9c7cfdaa0d..171370b0c7 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -5204,6 +5204,7 @@ int status_change_timer(int tid, unsigned int tick, int id, int data) if (!sc) { //Temporal debug until case is resolved. [Skotlex] ShowDebug("status_change_timer: Null pointer id: %d data: %d bl-type: %d\n", id, data, bl?bl->type:-1); + return 0; } if(bl->type==BL_PC)