v3.0.0: adjusted a few lines of code to include better safety checks

This commit is contained in:
Evan Debenham
2025-02-19 12:40:19 -05:00
parent 57d3b3039b
commit a73473836f
2 changed files with 7 additions and 5 deletions

View File

@@ -370,11 +370,12 @@ public class Ring extends KindofMisc {
for (RingBuff buff : target.buffs(type)) { for (RingBuff buff : target.buffs(type)) {
bonus += buff.level(); bonus += buff.level();
} }
SpiritForm.SpiritFormBuff spiritForm = target.buff(SpiritForm.SpiritFormBuff.class);
if (bonus == 0 if (bonus == 0
&& target.buff(SpiritForm.SpiritFormBuff.class) != null && spiritForm != null
&& target.buff(SpiritForm.SpiritFormBuff.class).ring() != null && spiritForm.ring() != null
&& target.buff(SpiritForm.SpiritFormBuff.class).ring().buffClass == type){ && spiritForm.ring().buffClass == type){
bonus += target.buff(SpiritForm.SpiritFormBuff.class).ring().soloBonus(); bonus += spiritForm.ring().soloBonus();
} }
return bonus; return bonus;
} }

View File

@@ -40,7 +40,8 @@ public class TargetHealthIndicator extends HealthBar {
public void update() { public void update() {
super.update(); super.update();
if (target != null && target.isAlive() && target.isActive() && target.sprite.visible) { if (target != null && target.isAlive() && target.isActive()
&& target.sprite != null && target.sprite.visible) {
CharSprite sprite = target.sprite; CharSprite sprite = target.sprite;
width = sprite.width(); width = sprite.width();
x = sprite.x; x = sprite.x;