v3.2.5: added a few safety checks for various rare errors
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user