From 341985a701d0155df6f69dccca969d1abccb3588 Mon Sep 17 00:00:00 2001 From: skotlex Date: Wed, 2 Aug 2006 17:06:16 +0000 Subject: - Fixed Defender Raising Walk speed instead of diminishing it. - Swaped val3/val4 of defender so that all walking penalty skills store said penalty in val3. - Added a check on status-change load to prevent loading speed-affecting status when their speed adjustment is 0 (prevents division by zero) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8061 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 4 ++++ src/map/script.c | 4 ---- src/map/status.c | 19 +++++++++++++++---- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 83cfeb2d3..cca8bf10d 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,10 @@ 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/08/02 + * Fixed Defender Raising Walk speed instead of diminishing it. [Skotlex] + * Added a check on status-change load to prevent loading speed-affecting + status when their speed adjustment is 0 (prevents division by zero) + [Skotlex] * Code cleanup & optimization on guild part of char-server [Toms] * Fixed script code data not being free'd if a player quits in the middle of a script. [Skotlex] diff --git a/src/map/script.c b/src/map/script.c index 23bc4c505..33bb2e1d9 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -2759,8 +2759,6 @@ void run_script_main(struct script_state *st) bk_st = NULL; } - - } /*========================================== @@ -10028,9 +10026,7 @@ int buildin_getpetinfo(struct script_state *st) break; case 2: if(sd->pet.name) - { push_str(st->stack,C_CONSTSTR,(unsigned char *) sd->pet.name); - } else push_str(st->stack,C_CONSTSTR, (unsigned char *) "null"); break; diff --git a/src/map/status.c b/src/map/status.c index 8ac13bb3a..56fbaa696 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -3458,7 +3458,7 @@ static unsigned short status_calc_speed(struct block_list *bl, struct status_cha if(sc->data[SC_DONTFORGETME].timer!=-1) speed = speed * 100/sc->data[SC_DONTFORGETME].val3; if(sc->data[SC_DEFENDER].timer!=-1) - speed = speed * 100/sc->data[SC_DEFENDER].val4; + speed = speed * 100/sc->data[SC_DEFENDER].val3; if(sc->data[SC_GOSPEL].timer!=-1 && sc->data[SC_GOSPEL].val4 == BCT_ENEMY) speed = speed * 100/75; if(sc->data[SC_JOINTBEAT].timer!=-1) { @@ -3568,7 +3568,7 @@ static short status_calc_aspd_rate(struct block_list *bl, struct status_change * if(sc->data[SC_SKA].timer!=-1) aspd_rate += 250; if(sc->data[SC_DEFENDER].timer != -1) - aspd_rate += sc->data[SC_DEFENDER].val3; + aspd_rate += sc->data[SC_DEFENDER].val4; if(sc->data[SC_GOSPEL].timer!=-1 && sc->data[SC_GOSPEL].val4 == BCT_ENEMY) aspd_rate += 250; if(sc->data[SC_GRAVITATION].timer!=-1) @@ -4971,8 +4971,8 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val struct map_session_data *tsd; int i; val2 = 5 + 15*val1; //Damage reduction - val3 = 250 - 50*val1; //Aspd adjustment - val4 = 135 - 5*val1; //Speed adjustment + val3 = 65 + 5*val1; //Speed adjustment + val4 = 250 - 50*val1; //Aspd adjustment if (sd) for (i = 0; i < 5; i++) @@ -5426,6 +5426,17 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val case SC_KAAHI: val4 = -1; break; + //In case the speed reduction comes loaded incorrectly, + //prevent division by 0. + case SC_DONTFORGETME: + case SC_CLOAKING: + case SC_LONGING: + case SC_HIDING: + case SC_CHASEWALK: + case SC_DEFENDER: + if (!val3) + return 0; + break; } //Those that make you stop attacking/walking.... switch (type) { -- cgit v1.2.3-70-g09d2