Przeglądaj źródła

Fixed "conversion from 'double' to 'int', possible loss of data"

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7939 54d463be-8e91-2dee-dedb-b68131a5f0ec
toms 19 lat temu
rodzic
commit
0f58cb2c3e
2 zmienionych plików z 2 dodań i 1 usunięć
  1. 1 0
      Changelog-Trunk.txt
  2. 1 1
      src/map/script.c

+ 1 - 0
Changelog-Trunk.txt

@@ -4,6 +4,7 @@ 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/07/28
+	* Fixed "conversion from 'double' to 'int', possible loss of data" [Toms]
 	* Fixed "warning: redefinition of [ushort/uint/ulong]" [Toms]
 	* Fixed duplicate case value on NJ_SUITON [Toms]
 2006/07/27

+ 1 - 1
src/map/script.c

@@ -2379,7 +2379,7 @@ void op_2num(struct script_state *st,int op,int i1,int i2)
 		if(ret_double > INT_MAX || ret_double < INT_MIN) {
 			printf("script::op_2num overflow detected op:%d\n",op);
 			report_src(st);
-			ret = cap_value(ret_double,INT_MAX,INT_MIN);
+			ret = (int)cap_value(ret_double,INT_MAX,INT_MIN);
 		}
 	}
 	push_val(st->stack,C_INT,ret);