summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-30 20:44:54 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-30 20:44:54 +0000
commit560b50abaf1e5c09ae85bd40d4d835c4f1c4283b (patch)
treed6db71045f2586de65e1f2d29af8e2c7c3f3a0aa /src
parentc8391c9c07abd235b2d40d8cfec39d62827706a7 (diff)
downloadhercules-560b50abaf1e5c09ae85bd40d4d835c4f1c4283b.tar.gz
hercules-560b50abaf1e5c09ae85bd40d4d835c4f1c4283b.tar.bz2
hercules-560b50abaf1e5c09ae85bd40d4d835c4f1c4283b.tar.xz
hercules-560b50abaf1e5c09ae85bd40d4d835c4f1c4283b.zip
- Fixed underflow issues when calculating dmotion.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6860 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/status.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 6ad8bfa14..068e7a733 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1937,9 +1937,9 @@ int status_calc_pc(struct map_session_data* sd,int first)
// ----- DMOTION -----
-//
- status->dmotion = 800-status->agi*4;
- if(status->dmotion<400) status->dmotion = 400;
+//
+ i = 800-status->agi*4;
+ status->dmotion = cap_value(i, 400, 800);
// ----- HP MAX CALCULATION -----
@@ -2360,12 +2360,11 @@ void status_calc_bl_sub_pc(struct map_session_data *sd, unsigned long flag)
if(flag&(SCB_AGI|SCB_DSPD)) {
//Even though people insist this is too slow, packet data reports this is the actual real equation.
- status->dmotion = 800-status->agi*4;
- if(status->dmotion<400) status->dmotion = 400;
+ skill = 800-status->agi*4;
+ status->dmotion = cap_value(skill, 400, 800);
if(battle_config.pc_damage_delay_rate != 100)
status->dmotion = status->dmotion*battle_config.pc_damage_delay_rate/100;
-
status->dmotion = status_calc_dmotion(&sd->bl, &sd->sc, b_status->dmotion);
}