diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-08-19 16:28:24 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-08-19 16:28:24 +0000 |
commit | 2bb0a3ba3259bc2db64d080ad4d450d7d9b99f74 (patch) | |
tree | ecd21447049e571b94c2375e21c4a5ab61387d73 /src/map/mob.c | |
parent | e65bb67b4b56419f1bcc4fe0579b2ede42891879 (diff) | |
download | hercules-2bb0a3ba3259bc2db64d080ad4d450d7d9b99f74.tar.gz hercules-2bb0a3ba3259bc2db64d080ad4d450d7d9b99f74.tar.bz2 hercules-2bb0a3ba3259bc2db64d080ad4d450d7d9b99f74.tar.xz hercules-2bb0a3ba3259bc2db64d080ad4d450d7d9b99f74.zip |
Set proper limits to drop rates to prevent integer overflow.
Minor details cleanup.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11043 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r-- | src/map/mob.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index c9b77475e..086c85380 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -3170,8 +3170,9 @@ static unsigned int mob_drop_adjust(int rate, int rate_adjust, unsigned short ra //Equation: Droprate(x,y) = x * (5 - log(x)) ^ (ln(y) / ln(5)) //x is the normal Droprate, y is the Modificator. rate = (int)(rate * pow((5.0 - log10(rate)), (log(rate_adjust/100.) / log(5.0))) + 0.5); - else //Classical linear rate adjustment. - rate = rate*rate_adjust/100; + else + //Classical linear rate adjustment. + rate = rate * rate_adjust/100; return cap_value(rate,rate_min,rate_max); } |