v3.0.0: adjusted a few lines of code to include better safety checks
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user