Quellcode durchsuchen

fix build

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@796 54d463be-8e91-2dee-dedb-b68131a5f0ec
amber vor 20 Jahren
Ursprung
Commit
4f93225e23
3 geänderte Dateien mit 16 neuen und 2 gelöschten Zeilen
  1. 1 1
      Changelog.txt
  2. 14 0
      src/common/mmo.h
  3. 1 1
      src/map/battle.c

+ 1 - 1
Changelog.txt

@@ -1,6 +1,6 @@
 Date	Added
 12/26
-	* Fixed some array bounds errors (SVN 795) [MouseJstr]
+	* Fixed some array bounds errors (SVN 796) [MouseJstr]
 	* @mapexit (and do_final) now persist all data to the
 	  char server before exiting to eliminate storage/inventory
 	  inconsistancies.. [MouseJstr]  (SVN 793)

+ 14 - 0
src/common/mmo.h

@@ -7,6 +7,20 @@
 #include <time.h>
 #include "utils.h" // _WIN32
 
+#if ! defined(Assert)
+#if defined(RELEASE)
+#define Assert(EX)
+#else
+// extern "C" {
+#include <assert.h>
+// }
+#if defined(_WIN32)
+#include <crtdbg.h>
+#endif
+#define Assert(EX) assert(EX)
+#endif
+#endif /* ! defined(Assert) */
+
 #ifdef CYGWIN
 // txtやlogなどの書き出すファイルの改行コード
 #define RETCODE	"\r\n"	// (CR/LF:Windows系)

+ 1 - 1
src/map/battle.c

@@ -3076,7 +3076,7 @@ static struct Damage battle_calc_pc_weapon_attack(
 		else
 			damage2 += atkmin_ ;
 		if(sd->atk_rate != 100 || sd->weapon_atk_rate != 0) {
-			if (((struct map_session_data *)bl)->status.weapon < 16) {
+			if (sd->status.weapon < 16) {
 				damage = (damage * (sd->atk_rate + sd->weapon_atk_rate[sd->status.weapon]))/100;
 				damage2 = (damage2 * (sd->atk_rate + sd->weapon_atk_rate[sd->status.weapon]))/100;
 			}