From cece111a565a6d53790248eaa01bf68615d3a4b1 Mon Sep 17 00:00:00 2001 From: toms Date: Fri, 25 Jan 2008 16:11:39 +0000 Subject: Updated conversion tools for mob_db & item_db Updated SQL Files (item & mobs) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12138 54d463be-8e91-2dee-dedb-b68131a5f0ec --- tools/mob_db.pl | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'tools/mob_db.pl') diff --git a/tools/mob_db.pl b/tools/mob_db.pl index de4e1b15e..e6eb859c4 100755 --- a/tools/mob_db.pl +++ b/tools/mob_db.pl @@ -77,21 +77,21 @@ while ($ligne=) $ligne = $&; if ($ligne =~ /^\/\//) { - printf("# %s\n", $ligne); + printf("# "); + $ligne = substr($ligne, 2); + } + @champ = split (",",$ligne); + if ($#champ != $nb_columns - 1) + { + # Can't parse, it's a real comment + printf ("%s\n", $ligne); } else { - @champ = split (",(?![^{]*[})])",$ligne); - if ($#champ != $nb_columns - 1) + printf("REPLACE INTO `%s` VALUES (", $db); + for ($i=0; $i<$#champ; $i++) { - printf ("# WARNING BAD LINE : %d (%s)\n", $#champ, $ligne); - printf STDERR ("Warning : can't parse %s\n", $ligne); - } else { - printf("REPLACE INTO `%s` VALUES (", $db); - for ($i=0; $i<$#champ; $i++) - { - printField($champ[$i],",",$i); - } - printField($champ[$#champ],");\n",$#champ); + printField($champ[$i],",",$i); } + printField($champ[$#champ],");\n",$#champ); } } } -- cgit v1.2.3-70-g09d2