v0.6.2c: fixed a variety of rare crash bugs

This commit is contained in:
Evan Debenham
2017-11-12 23:30:57 -05:00
committed by Evan Debenham
parent 31042228ff
commit 1fbaa27f5b
6 changed files with 14 additions and 17 deletions
@@ -220,7 +220,7 @@ public abstract class Actor implements Bundlable {
current = null;
} else {
doNext = acting.act();
if (doNext && !Dungeon.hero.isAlive()) {
if (doNext && (Dungeon.hero == null || !Dungeon.hero.isAlive())) {
doNext = false;
current = null;
}
@@ -72,7 +72,7 @@ public class Buff extends Actor {
}
public void detach() {
fx( false );
if (target.sprite != null) fx( false );
target.remove( this );
}
@@ -107,7 +107,7 @@ public class BrokenSeal extends Item {
private float partialShield;
@Override
public boolean act() {
public synchronized boolean act() {
if (armor == null) detach();
else if (armor.isEquipped((Hero)target)) {
if (target.SHLD < maxShield()){
@@ -122,11 +122,11 @@ public class BrokenSeal extends Item {
return true;
}
public void setArmor(Armor arm){
public synchronized void setArmor(Armor arm){
armor = arm;
}
public int maxShield() {
public synchronized int maxShield() {
return 1 + armor.tier + armor.level();
}
}
@@ -300,7 +300,7 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
flashTime = FLASH_INTERVAL;
}
public void add( State state ) {
public synchronized void add( State state ) {
switch (state) {
case BURNING:
burning = emitter();
@@ -350,7 +350,7 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
}
}
public void remove( State state ) {
public synchronized void remove( State state ) {
switch (state) {
case BURNING:
if (burning != null) {
@@ -414,7 +414,6 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
}
@Override
//syncronized due to EmoIcon handling
public synchronized void update() {
super.update();