v2.5.0: fixed crash errors in catalogs

This commit is contained in:
Evan Debenham
2024-08-25 22:18:27 -04:00
parent 2a1f46b21c
commit 3cc21b55a8
3 changed files with 8 additions and 5 deletions

View File

@@ -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

View File

@@ -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();
}

View File

@@ -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 {