summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-28 14:42:04 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-28 14:42:04 +0000
commit0ce51345c593a04feb87d338fe74189cfb603223 (patch)
treefdb3100a425c109061b91bea61b53547e3b8952e /src/map
parentad245cf78e5433863b990b581483dcd1523526ce (diff)
downloadhercules-0ce51345c593a04feb87d338fe74189cfb603223.tar.gz
hercules-0ce51345c593a04feb87d338fe74189cfb603223.tar.bz2
hercules-0ce51345c593a04feb87d338fe74189cfb603223.tar.xz
hercules-0ce51345c593a04feb87d338fe74189cfb603223.zip
- Fixed a compile warning in the login txt/sql server.
- Changed the mob drop rate adjust function to receive a signed int argument. Probably will fix those drops with 0% becoming 100% git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7371 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/mob.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 2b1673687..ab195ecac 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -3060,7 +3060,7 @@ static int mob_makedummymobdb(int class_)
}
//Adjusts the drop rate of item according to the criteria given. [Skotlex]
-static unsigned int mob_drop_adjust(unsigned int rate, int rate_adjust, unsigned short rate_min, unsigned short rate_max)
+static unsigned int mob_drop_adjust(int rate, int rate_adjust, unsigned short rate_min, unsigned short rate_max)
{
if (battle_config.logarithmic_drops && rate_adjust > 0) //Logarithmic drops equation by Ishizu-Chan
//Equation: Droprate(x,y) = x * (5 - log(x)) ^ (ln(y) / ln(5))
@@ -3068,7 +3068,7 @@ static unsigned int mob_drop_adjust(unsigned int rate, int rate_adjust, unsigned
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;
- return (rate>rate_max)?rate_max:((rate<rate_min)?rate_min:rate);
+ return cap_value(rate,rate_min,rate_max);
}
/*==========================================
* mob_db.txt reading