v3.2.5: added a few safety checks for various rare errors

This commit is contained in:
Evan Debenham
2025-09-28 11:11:28 -04:00
parent 6d179184be
commit 218e1216af
4 changed files with 11 additions and 7 deletions

View File

@@ -607,7 +607,7 @@ public class Hero extends Char {
Combo.ParryTracker parry = buff(Combo.ParryTracker.class);
if (parry != null){
parry.parried = true;
if (buff(Combo.class).getComboCount() < 9 || pointsInTalent(Talent.ENHANCED_COMBO) < 2){
if (buff(Combo.class) == null || buff(Combo.class).getComboCount() < 9 || pointsInTalent(Talent.ENHANCED_COMBO) < 2){
parry.detach();
}
return Messages.get(Monk.class, "parried");

View File

@@ -502,7 +502,7 @@ public abstract class Mob extends Char {
protected boolean getCloser( int target ) {
if (rooted || target == pos) {
if (rooted || target == pos || !Dungeon.level.insideMap(target)) {
return false;
}

View File

@@ -140,7 +140,6 @@ import com.watabou.noosa.audio.Sample;
import com.watabou.noosa.particles.Emitter;
import com.watabou.noosa.tweeners.Tweener;
import com.watabou.utils.Callback;
import com.watabou.utils.DeviceCompat;
import com.watabou.utils.GameMath;
import com.watabou.utils.PlatformSupport;
import com.watabou.utils.Point;
@@ -1465,10 +1464,12 @@ public class GameScene extends PixelScene {
@Override
public void call() {
//greater than 0 to account for negative values (which have the first bit set to 1)
if (color > 0 && color < 0x01000000) {
scene.fadeIn(0xFF000000 | color, lightmode);
} else {
scene.fadeIn(color, lightmode);
if (scene != null) {
if (color > 0 && color < 0x01000000) {
scene.fadeIn(0xFF000000 | color, lightmode);
} else {
scene.fadeIn(color, lightmode);
}
}
}
});

View File

@@ -349,6 +349,9 @@ public class QuickSlotButton extends Button {
//FIXME: this is currently very expensive, should either optimize ballistica or this, or both
public static int autoAim(Char target, Item item){
if (Dungeon.hero == null){
return -1;
}
//first try to directly target
if (item.targetingPos(Dungeon.hero, target.pos) == target.pos) {