v0.6.2d: fixed various crash bugs and added safety checks

This commit is contained in:
Evan Debenham 2017-11-16 12:30:10 -05:00 committed by Evan Debenham
parent 433d862882
commit 62c5aeffc8
2 changed files with 5 additions and 3 deletions

View File

@ -80,8 +80,10 @@ public class SpellSprite extends Image {
public void update() {
super.update();
x = target.sprite.center().x - SIZE / 2;
y = target.sprite.y - SIZE;
if (target.sprite != null) {
x = target.sprite.center().x - SIZE / 2;
y = target.sprite.y - SIZE;
}
switch (phase) {
case FADE_IN:

View File

@ -41,7 +41,7 @@ public class MageArmor extends ClassArmor {
@Override
public void doSpecial() {
for (Mob mob : Dungeon.level.mobs) {
for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) {
if (Dungeon.level.heroFOV[mob.pos]) {
Buff.affect( mob, Burning.class ).reignite( mob );
Buff.prolong( mob, Roots.class, 3 );