Merge branch 'patch-totem-extradata' into 'dev'

added remaining NumberFormatExceptions in totem interactions to try/catch block

See merge request morningstar/Arcturus-Community!73
This commit is contained in:
Harmonic 2020-01-19 20:42:51 -05:00
commit 395cba2a5f
2 changed files with 12 additions and 2 deletions

View File

@ -35,7 +35,12 @@ public class InteractionTotemHead extends InteractionDefault {
}
public TotemColor getTotemColor() {
int extraData = Integer.parseInt(this.getExtradata());
int extraData;
try {
extraData = Integer.parseInt(this.getExtradata());
}catch(NumberFormatException ex) {
extraData = 0;
}
if(extraData < 3) {
return TotemColor.NONE;
}

View File

@ -31,7 +31,12 @@ public class InteractionTotemLegs extends InteractionDefault {
}
public TotemColor getTotemColor() {
int extraData = Integer.parseInt(this.getExtradata());
int extraData;
try {
extraData = Integer.parseInt(this.getExtradata());
} catch(NumberFormatException ex) {
extraData = 0;
}
return TotemColor.fromInt(extraData - (4 * (getTotemType().type - 1)));
}