ソースを参照

Fixed "comparison of unsigned expression < 0 is always false" warning.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16412 54d463be-8e91-2dee-dedb-b68131a5f0ec
shennetsind 13 年 前
コミット
6f5c5516f1
2 ファイル変更5 行追加4 行削除
  1. 2 1
      src/map/itemdb.c
  2. 3 3
      src/map/status.c

+ 2 - 1
src/map/itemdb.c

@@ -6,6 +6,7 @@
 #include "../common/random.h"
 #include "../common/showmsg.h"
 #include "../common/strlib.h"
+#include "../common/utils.h"
 #include "itemdb.h"
 #include "map.h"
 #include "battle.h" // struct battle_config
@@ -1003,7 +1004,7 @@ static bool itemdb_parse_dbrow(char** str, const char* source, int line, int scr
 		id->type = IT_ETC;
 	}
 
-	id->wlv = atoi(str[15]);
+	id->wlv = cap_value(atoi(str[15]), REFINE_TYPE_ARMOR, REFINE_TYPE_MAX);
 	id->elv = atoi(str[16]);
 	id->flag.no_refine = atoi(str[17]) ? 0 : 1; //FIXME: verify this
 	id->look = atoi(str[18]);

+ 3 - 3
src/map/status.c

@@ -10600,9 +10600,9 @@ static int status_natural_heal_timer(int tid, unsigned int tick, int id, intptr_
  * @param refine The target refine level
  * @return The chance to refine the item, in percent (0~100)
  **/
-int status_get_refine_chance(enum refine_type wlv, int refine)
-{
-	 if (wlv < 0 || wlv > REFINE_TYPE_MAX || refine < 0 || refine >= MAX_REFINE)
+int status_get_refine_chance(enum refine_type wlv, int refine) {
+	 
+	if ( refine < 0 || refine >= MAX_REFINE)
 		return 0;
 
 	return refine_info[wlv].chance[refine];