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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user