Jelajahi Sumber

- 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://svn.code.sf.net/p/rathena/svn/trunk@7371 54d463be-8e91-2dee-dedb-b68131a5f0ec

skotlex 19 tahun lalu
induk
melakukan
029be2fe93
4 mengubah file dengan 8 tambahan dan 4 penghapusan
  1. 2 0
      Changelog-Trunk.txt
  2. 2 0
      src/login/login.c
  3. 2 2
      src/login_sql/login.c
  4. 2 2
      src/map/mob.c

+ 2 - 0
Changelog-Trunk.txt

@@ -4,6 +4,8 @@ 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/05/28
+	* Changed the mob drop rate adjust function to receive a signed int
+	  argument. Probably will fix those drops with 0% becoming 100% [Skotlex]
 	* Corrected Musical Strike having a different damage equation from Throw
 	  Arrow. [Skotlex]
 	* Added state rewarp to players. It gets set when a pc_setpos call is

+ 2 - 0
src/login/login.c

@@ -175,6 +175,8 @@ int use_md5_passwds = 0;
 
 int console = 0;
 
+int charif_sendallwos(int sfd, unsigned char *buf, unsigned int len);
+
 //------------------------------
 // Writing function of logs file
 //------------------------------

+ 2 - 2
src/login_sql/login.c

@@ -159,6 +159,8 @@ static void* create_online_user(DBKey key, va_list args) {
 	return p;	
 }
 
+int charif_sendallwos(int sfd, unsigned char *buf, unsigned int len);
+
 //-----------------------------------------------------
 // Online User Database [Wizputer]
 //-----------------------------------------------------
@@ -237,8 +239,6 @@ void read_gm_account(void) {
 	}
 }
 
-int charif_sendallwos(int sfd, unsigned char *buf, unsigned int len);
-
 //-----------------------------------------------------
 // Send GM accounts to all char-server
 //-----------------------------------------------------

+ 2 - 2
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