summaryrefslogtreecommitdiff
path: root/tools/itemdbconverter.pl
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2013-11-16 03:39:29 +0100
committerHaru <haru@dotalux.com>2013-11-16 03:41:14 +0100
commitd1a635a06f5152b51d0879176f011b5c6e45431c (patch)
tree51f0343755ab626758604ab2e485097ec4f80f30 /tools/itemdbconverter.pl
parent862046bc034985a12b230293fe7d8dd8fade9f53 (diff)
downloadhercules-d1a635a06f5152b51d0879176f011b5c6e45431c.tar.gz
hercules-d1a635a06f5152b51d0879176f011b5c6e45431c.tar.bz2
hercules-d1a635a06f5152b51d0879176f011b5c6e45431c.tar.xz
hercules-d1a635a06f5152b51d0879176f011b5c6e45431c.zip
Improved itemdb converter robustness in case of extra spaces
- Thanks to GM.PiXeL for reporting the issue. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'tools/itemdbconverter.pl')
-rwxr-xr-xtools/itemdbconverter.pl36
1 files changed, 18 insertions, 18 deletions
diff --git a/tools/itemdbconverter.pl b/tools/itemdbconverter.pl
index 54c17262d..13805c09e 100755
--- a/tools/itemdbconverter.pl
+++ b/tools/itemdbconverter.pl
@@ -74,25 +74,25 @@ sub parsedb (@) {
# ID,AegisName,Name,Type,Buy,Sell,Weight,ATK,DEF,Range,Slots,Job,Upper,Gender,Loc,wLV,eLV,Refineable,View,{ Script },{ OnEquip_Script },{ OnUnequip_Script }
if( $_ =~ qr/^
(?<prefix>(?:\/\/[^0-9]*)?)
- (?<ID>[0-9]+),
+ (?<ID>[0-9]+)[^,]*,
(?<AegisName>[^,]+),
- (?<Name>[^,]+),
- (?<Type>[0-9]+),
- (?<Buy>[0-9]*),
- (?<Sell>[0-9]*),
- (?<Weight>[0-9]*),
- (?<ATK>[0-9-]*)(?<hasmatk>:(?<MATK>[0-9-]*))?,
- (?<DEF>[0-9-]*),
- (?<Range>[0-9]*),
- (?<Slots>[0-9]*),
- (?<Job>[x0-9A-Fa-f]*),
- (?<Upper>[0-9]*),
- (?<Gender>[0-9]*),
- (?<Loc>[0-9]*),
- (?<wLV>[0-9]*),
- (?<eLV>[0-9]*)(?<hasmaxlv>:(?<eLVmax>[0-9]*))?,
- (?<Refineable>[0-9]*),
- (?<View>[0-9]*),
+ (?<Name>[^,]+),[\s\t]*
+ (?<Type>[0-9]+)[^,]*,[\s\t]*
+ (?<Buy>[0-9]*)[^,]*,[\s\t]*
+ (?<Sell>[0-9]*)[^,]*,[\s\t]*
+ (?<Weight>[0-9]*)[^,]*,[\s\t]*
+ (?<ATK>[0-9-]*)[^,:]*(?<hasmatk>:[\s\t]*(?<MATK>[0-9-]*))?[^,]*,[\s\t]*
+ (?<DEF>[0-9-]*)[^,]*,[\s\t]*
+ (?<Range>[0-9]*)[^,]*,[\s\t]*
+ (?<Slots>[0-9]*)[^,]*,[\s\t]*
+ (?<Job>[x0-9A-Fa-f]*)[^,]*,[\s\t]*
+ (?<Upper>[0-9]*)[^,]*,[\s\t]*
+ (?<Gender>[0-9]*)[^,]*,[\s\t]*
+ (?<Loc>[0-9]*)[^,]*,[\s\t]*
+ (?<wLV>[0-9]*)[^,]*,[\s\t]*
+ (?<eLV>[0-9]*)[^,:]*(?<hasmaxlv>:[\s\t]*(?<eLVmax>[0-9]*))?[^,]*,[\s\t]*
+ (?<Refineable>[0-9]*)[^,]*,[\s\t]*
+ (?<View>[0-9]*)[^,]*,[\s\t]*
{(?<Script>.*)},
{(?<OnEquip>.*)},
{(?<OnUnequip>.*)}