Fixed bug with null String values in Touhou Mother module.

This commit is contained in:
sigonasr2 2018-06-02 23:15:57 -05:00
parent dd3d9148f3
commit 6dd2145ef9
3 changed files with 6 additions and 2 deletions

Binary file not shown.

View File

@ -164,7 +164,7 @@ public class TouhouMotherModule extends Module implements ActionListener{
public void actionPerformed(ActionEvent ev) { public void actionPerformed(ActionEvent ev) {
//memory = FileUtils.readFromFile(sigIRC.BASEDIR+"memory"); //memory = FileUtils.readFromFile(sigIRC.BASEDIR+"memory");
//System.out.println(Arrays.toString(memory)); //System.out.println(Arrays.toString(memory));
memory = new String[19]; memory = new String[]{"","","","","","","","","","","","","","","","","","",""};
if (foundTouhouMother) { if (foundTouhouMother) {
memory[0] = Integer.toString(ReadIntFromBuriedMemoryOffset(0xA2A84,0x6DC,0x2C0,0x8,0x6AC,0x2F0)); memory[0] = Integer.toString(ReadIntFromBuriedMemoryOffset(0xA2A84,0x6DC,0x2C0,0x8,0x6AC,0x2F0));

View File

@ -33,7 +33,11 @@ public class TextUtils {
public static boolean isNumeric(String str) public static boolean isNumeric(String str)
{ {
return str.matches("-?\\d+(\\.\\d+)?"); //match a number with optional '-' and decimal. if (str.length()>0) {
return str.matches("-?\\d+(\\.\\d+)?"); //match a number with optional '-' and decimal.
} else {
return false;
}
} }
public static boolean isInteger(String s, int radix) { public static boolean isInteger(String s, int radix) {