v2.5.0: fixed crash errors in catalogs
This commit is contained in:
@@ -112,8 +112,9 @@ public class Dart extends MissileWeapon {
|
||||
protected static Crossbow bow;
|
||||
|
||||
private void updateCrossbow(){
|
||||
if (Dungeon.hero == null) return;
|
||||
if (Dungeon.hero.belongings.weapon() instanceof Crossbow){
|
||||
if (Dungeon.hero == null) {
|
||||
bow = null;
|
||||
} else if (Dungeon.hero.belongings.weapon() instanceof Crossbow){
|
||||
bow = (Crossbow) Dungeon.hero.belongings.weapon();
|
||||
} else if (Dungeon.hero.belongings.secondWep() instanceof Crossbow) {
|
||||
//player can instant swap anyway, so this is just QoL
|
||||
|
||||
@@ -198,7 +198,7 @@ public abstract class TippedDart extends Dart {
|
||||
float usages = Math.round(MAX_DURABILITY/use);
|
||||
|
||||
//grants 3+lvl extra uses with charged shot
|
||||
if (bow != null && Dungeon.hero.buff(Crossbow.ChargedShot.class) != null){
|
||||
if (bow != null && Dungeon.hero != null && Dungeon.hero.buff(Crossbow.ChargedShot.class) != null){
|
||||
usages += 3 + bow.buffedLvl();
|
||||
}
|
||||
|
||||
|
||||
@@ -147,8 +147,10 @@ public class GooSprite extends MobSprite {
|
||||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
spray.pos(center());
|
||||
spray.visible = visible;
|
||||
if (spray != null) {
|
||||
spray.pos(center());
|
||||
spray.visible = visible;
|
||||
}
|
||||
}
|
||||
|
||||
public static class GooParticle extends PixelParticle.Shrinking {
|
||||
|
||||
Reference in New Issue
Block a user