diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-11-13 07:48:44 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-11-13 07:48:44 +0000 |
commit | 6a814eaf780a34312fdfa85b7f3936f880d70e83 (patch) | |
tree | 21a808ffa325db9296dffa44f18e62aa71db3fb8 /src/map/skill.c | |
parent | 0c1406c5703dfa5584b8128468a78692c3869cab (diff) | |
download | hercules-6a814eaf780a34312fdfa85b7f3936f880d70e83.tar.gz hercules-6a814eaf780a34312fdfa85b7f3936f880d70e83.tar.bz2 hercules-6a814eaf780a34312fdfa85b7f3936f880d70e83.tar.xz hercules-6a814eaf780a34312fdfa85b7f3936f880d70e83.zip |
Added error reporting for invalid rows in skill db files.
Fixed skill_castnodex_db.txt not being parsed correctly.
Fixed a search&replace typo in skill_db.txt.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11728 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r-- | src/map/skill.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index c929de450..0918eeed4 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -10733,7 +10733,8 @@ static bool skill_read_csvdb( const char* directory, const char* filename, int m continue; //TODO: strip trailing // comment //TODO: strip trailing whitespace - //TODO: skip empty lines + if( line[0] == '\0' || line[0] == '\n' ) + continue; memset(split,0,sizeof(split)); columns = skill_split_str(line,split,ARRAYLENGTH(split)); @@ -10751,8 +10752,14 @@ static bool skill_read_csvdb( const char* directory, const char* filename, int m } // parse this row - if( parseproc(split, columns, entries) ) - entries++; + if( !parseproc(split, columns, entries) ) + { + ShowError("skill_read_csvdb: Could not process contents of line %d of \"%s\".\n", lines, path); + continue; // invalid row contents? + } + + // success! + entries++; } fclose(fp); @@ -11016,9 +11023,8 @@ static bool skill_parse_row_castnodexdb(char* split[], int columns, int current) return false; skill_split_atoi(split[1],skill_db[i].castnodex); - if( !split[2] ) // optional column - return false; - skill_split_atoi(split[2],skill_db[i].delaynodex); + if( split[2] ) // optional column + skill_split_atoi(split[2],skill_db[i].delaynodex); return true; } |