Make sure Explosions cleanup after themselves.
Apparrently, == 0 was not enough.
This commit is contained in:
parent
48e3ac275c
commit
4017d369b1
|
@ -58,7 +58,7 @@ public class Explosion extends Entity {
|
|||
*/
|
||||
public void update() {
|
||||
this.timeToLive--;
|
||||
if(this.timeToLive == 0) this.remove();
|
||||
if(this.timeToLive <= 0) this.remove();
|
||||
if(this.count > 0 && this.timeToLive % this.count == 0) {
|
||||
new Explosion(this.getX() + (int) (this.width * this.random.nextDouble()), this.getY() + (int) (this.height * this.random.nextDouble()));
|
||||
this.count--;
|
||||
|
|
Loading…
Reference in New Issue