瀏覽代碼

Fixed a damage underflow (bugreport:3624)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14077 54d463be-8e91-2dee-dedb-b68131a5f0ec
Inkfish 15 年之前
父節點
當前提交
df4857ca11
共有 2 個文件被更改,包括 4 次插入6 次删除
  1. 2 0
      Changelog-Trunk.txt
  2. 2 6
      src/map/battle.c

+ 2 - 0
Changelog-Trunk.txt

@@ -3,6 +3,8 @@ Date	Added
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
+09/10/02
+	* Fixed a damage underflow.(bugreport:3624) [Inkfish]
 09/09/23
 	* Added supports for Soul Bound. [Inkfish]
 09/09/21

+ 2 - 6
src/map/battle.c

@@ -1840,12 +1840,8 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
 			}
 			if (def1 > 100) def1 = 100;
 			ATK_RATE2(
-				flag.idef ?100:
-				(flag.pdef ?flag.pdef *(def1 + vit_def):
-				100-def1),
-			  	flag.idef2?100:
-				(flag.pdef2?flag.pdef2*(def1 + vit_def):
-				100-def1)
+				flag.idef ?100:(flag.pdef ?(int)(flag.pdef *(def1+vit_def)):(100-def1)),
+			 	flag.idef2?100:(flag.pdef2?(int)(flag.pdef2*(def1+vit_def)):(100-def1))
 			);
 			ATK_ADD2(
 				flag.idef ||flag.pdef ?0:-vit_def,