Fixed Champion Monster modes (fixes #1226)

* The monster modes were stored in decimal format so the converter created invalid hexadecimal modes.
* Resolved a few issues with the Monster Converter tool.
-- Fixed some run time errors.
-- Added support to check for decimal format when converting.
This commit is contained in:
aleos89
2016-05-03 10:48:51 -04:00
parent b14b3e2888
commit 79ba46c9a0
2 changed files with 316 additions and 313 deletions

View File

@@ -46,8 +46,9 @@ sub convertmode {
$bits |= 64;
}
if ($mexp > 0) # MD_MVP
if ($mexp > 0) { # MD_MVP
$bits |= 524288;
}
return $bits;
}
@@ -124,9 +125,11 @@ sub Main {
}
}
if(scalar(@champ>0)){
$mode = $champ[25];
$mexp = $champ[30];
$champ[25] = sprintf("0x%X", convertmode($mode, $mexp));
if($champ[25] =~ /^0[xX]/) {
$champ[25] = sprintf("0x%X", convertmode($champ[25], $champ[30]));
} else {
$champ[25] = sprintf("0x%X", convertmode(sprintf("0x%X", $champ[25]), $champ[30]));
}
my $newline = join(",",@champ);
print FHOUT $newline;
}