Browse Source

only the first 22 CSVs were read in, but MAX_WEAPON_TYPE+5 was 27 -> uninitialized array indices got atoi'd

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5539 54d463be-8e91-2dee-dedb-b68131a5f0ec
blackhole89 19 years ago
parent
commit
a2a0e1e323
3 changed files with 8 additions and 3 deletions
  1. 1 0
      Changelog-Trunk.txt
  2. 5 1
      src/map/skill.c
  3. 2 2
      src/map/status.c

+ 1 - 0
Changelog-Trunk.txt

@@ -5,6 +5,7 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.  EV
 GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
 
 2006/03/09
+	* Fixed a critical bug in job_db1.txt reading in status_readdb. [blackhole89]
 	* Fixed pc_damage_sp not properly substracting SP. [Skotlex]
 	* Made Magic Crasher a BF_WEAPON attack. [Skotlex]
 	* Made skill_unit_range a per-level setting. meteor and Lov now have their

+ 5 - 1
src/map/skill.c

@@ -6272,9 +6272,13 @@ int skill_castend_pos2( struct block_list *src, int x,int y,int skillid,int skil
 	case NJ_KAENSIN:
 	case NJ_BAKUENRYU:
 	case NJ_HYOUSYOURAKU:
-	case NJ_RAIGEKISAI:
 		skill_unitsetting(src,skillid,skilllv,x,y,0);
 		break;
+	case NJ_RAIGEKISAI:
+		map_foreachinrange(skill_attack_area, src,
+			skill_get_splash(skillid, skilllv), BL_CHAR,
+			BF_MAGIC, src, src, skillid, skilllv, tick, flag, BCT_ENEMY);
+		break;
 	}
 
 	if (sc && sc->data[SC_MAGICPOWER].timer != -1)

+ 2 - 2
src/map/status.c

@@ -5740,12 +5740,12 @@ int status_readdb(void) {
 		char *split[MAX_WEAPON_TYPE + 5];
 		if(line[0]=='/' && line[1]=='/')
 			continue;
-		for(j=0,p=line;j<22 && p;j++){
+		for(j=0,p=line;j<(MAX_WEAPON_TYPE + 5) && p;j++){	//not 22 anymore [blackhole89]
 			split[j]=p;
 			p=strchr(p,',');
 			if(p) *p++=0;
 		}
-		if(j<22)
+		if(j<(MAX_WEAPON_TYPE + 5))
 			continue;
        	if(atoi(split[0])>=MAX_PC_CLASS)
 		    continue;