v0.8.2c: adjusted emitters to fix a race condition
This commit is contained in:
parent
4cabe069a1
commit
0a6127b843
|
@ -44,7 +44,8 @@ public class Emitter extends Group {
|
||||||
protected int quantity;
|
protected int quantity;
|
||||||
|
|
||||||
public boolean on = false;
|
public boolean on = false;
|
||||||
|
|
||||||
|
private boolean started = false;
|
||||||
public boolean autoKill = true;
|
public boolean autoKill = true;
|
||||||
|
|
||||||
protected int count;
|
protected int count;
|
||||||
|
@ -87,7 +88,9 @@ public class Emitter extends Group {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void start( Factory factory, float interval, int quantity ) {
|
public void start( Factory factory, float interval, int quantity ) {
|
||||||
|
|
||||||
|
started = true;
|
||||||
|
|
||||||
this.factory = factory;
|
this.factory = factory;
|
||||||
this.lightMode = factory.lightMode();
|
this.lightMode = factory.lightMode();
|
||||||
|
|
||||||
|
@ -113,13 +116,19 @@ public class Emitter extends Group {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (autoKill && countLiving() == 0) {
|
} else if (started && autoKill && countLiving() == 0) {
|
||||||
kill();
|
kill();
|
||||||
}
|
}
|
||||||
|
|
||||||
super.update();
|
super.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void revive() {
|
||||||
|
started = false;
|
||||||
|
super.revive();
|
||||||
|
}
|
||||||
|
|
||||||
protected void emit( int index ) {
|
protected void emit( int index ) {
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
factory.emit(
|
factory.emit(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user