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);
|
Combo.ParryTracker parry = buff(Combo.ParryTracker.class);
|
||||||
if (parry != null){
|
if (parry != null){
|
||||||
parry.parried = true;
|
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();
|
parry.detach();
|
||||||
}
|
}
|
||||||
return Messages.get(Monk.class, "parried");
|
return Messages.get(Monk.class, "parried");
|
||||||
|
|||||||
@@ -502,7 +502,7 @@ public abstract class Mob extends Char {
|
|||||||
|
|
||||||
protected boolean getCloser( int target ) {
|
protected boolean getCloser( int target ) {
|
||||||
|
|
||||||
if (rooted || target == pos) {
|
if (rooted || target == pos || !Dungeon.level.insideMap(target)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -140,7 +140,6 @@ import com.watabou.noosa.audio.Sample;
|
|||||||
import com.watabou.noosa.particles.Emitter;
|
import com.watabou.noosa.particles.Emitter;
|
||||||
import com.watabou.noosa.tweeners.Tweener;
|
import com.watabou.noosa.tweeners.Tweener;
|
||||||
import com.watabou.utils.Callback;
|
import com.watabou.utils.Callback;
|
||||||
import com.watabou.utils.DeviceCompat;
|
|
||||||
import com.watabou.utils.GameMath;
|
import com.watabou.utils.GameMath;
|
||||||
import com.watabou.utils.PlatformSupport;
|
import com.watabou.utils.PlatformSupport;
|
||||||
import com.watabou.utils.Point;
|
import com.watabou.utils.Point;
|
||||||
@@ -1465,12 +1464,14 @@ public class GameScene extends PixelScene {
|
|||||||
@Override
|
@Override
|
||||||
public void call() {
|
public void call() {
|
||||||
//greater than 0 to account for negative values (which have the first bit set to 1)
|
//greater than 0 to account for negative values (which have the first bit set to 1)
|
||||||
|
if (scene != null) {
|
||||||
if (color > 0 && color < 0x01000000) {
|
if (color > 0 && color < 0x01000000) {
|
||||||
scene.fadeIn(0xFF000000 | color, lightmode);
|
scene.fadeIn(0xFF000000 | color, lightmode);
|
||||||
} else {
|
} else {
|
||||||
scene.fadeIn(color, lightmode);
|
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
|
//FIXME: this is currently very expensive, should either optimize ballistica or this, or both
|
||||||
public static int autoAim(Char target, Item item){
|
public static int autoAim(Char target, Item item){
|
||||||
|
if (Dungeon.hero == null){
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
//first try to directly target
|
//first try to directly target
|
||||||
if (item.targetingPos(Dungeon.hero, target.pos) == target.pos) {
|
if (item.targetingPos(Dungeon.hero, target.pos) == target.pos) {
|
||||||
|
|||||||
Reference in New Issue
Block a user