summaryrefslogtreecommitdiff
path: root/src/map/status.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-31 01:10:36 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-31 01:10:36 +0000
commit73726c90a229856a88c55fe5121ea511ac2c228d (patch)
tree15fb72e95d20c107315c964d8eede3a208868161 /src/map/status.c
parent783d562f6761579e80277ae7417fa56e0be137e2 (diff)
downloadhercules-73726c90a229856a88c55fe5121ea511ac2c228d.tar.gz
hercules-73726c90a229856a88c55fe5121ea511ac2c228d.tar.bz2
hercules-73726c90a229856a88c55fe5121ea511ac2c228d.tar.xz
hercules-73726c90a229856a88c55fe5121ea511ac2c228d.zip
- Skill required-state will now only be checked on cast-begin, not cast-end.
- Added a check in status_calc_pc to prevent player rate adjustments from from going below 0. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8553 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r--src/map/status.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 34459b495..1fe73423f 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -2109,7 +2109,43 @@ int status_calc_pc(struct map_session_data* sd,int first)
sd->dsprate -= sd->sc.data[SC_SERVICE4U].val3;
}
- if(sd->dsprate < 0) sd->dsprate = 0;
+ //Underflow protections.
+ if(sd->sprate < 0)
+ sd->sprate = 0;
+ if(sd->dsprate < 0)
+ sd->dsprate = 0;
+ if(sd->hprate < 0)
+ sd->hprate = 0;
+ if(sd->sprate < 0)
+ sd->sprate = 0;
+ if(sd->castrate < 0)
+ sd->castrate = 0;
+ if(sd->delayrate < 0)
+ sd->delayrate = 0;
+ if(sd->speed_rate < 0)
+ sd->speed_rate = 0;
+ if(sd->hprecov_rate < 0)
+ sd->hprecov_rate = 0;
+ if(sd->sprecov_rate < 0)
+ sd->sprecov_rate = 0;
+ if(sd->matk_rate < 0)
+ sd->matk_rate = 0;
+ if(sd->critical_rate < 0)
+ sd->critical_rate = 0;
+ if(sd->hit_rate < 0)
+ sd->hit_rate = 0;
+ if(sd->flee_rate < 0)
+ sd->flee_rate = 0;
+ if(sd->flee2_rate < 0)
+ sd->flee2_rate = 0;
+ if(sd->def_rate < 0)
+ sd->def_rate = 0;
+ if(sd->def2_rate < 0)
+ sd->def2_rate = 0;
+ if(sd->mdef_rate < 0)
+ sd->mdef_rate = 0;
+ if(sd->mdef2_rate < 0)
+ sd->mdef2_rate = 0;
// Anti-element and anti-race
if((skill=pc_checkskill(sd,CR_TRUST))>0)