added null ckeck for boostTask and boostRefillTask

This commit is contained in:
2025-10-15 21:30:11 +02:00
parent eff5e36987
commit 35dc924104

View File

@@ -46,8 +46,8 @@ public class Turtle extends EntityCreature {
this.removePassenger(this.player);
this.remove();
this.kill();
if(this.boostRefillTask.isAlive()) this.boostRefillTask.cancel();
if(this.boostTask.isAlive()) this.boostTask.cancel();
if(this.boostRefillTask != null && this.boostRefillTask.isAlive()) this.boostRefillTask.cancel();
if(this.boostTask != null && this.boostTask.isAlive()) this.boostTask.cancel();
}
public void adaptView() {
@@ -82,7 +82,7 @@ public class Turtle extends EntityCreature {
}
public void cancelBoost() {
if(!this.boostTask.isAlive()) return;
if(this.boostTask == null || !this.boostTask.isAlive()) return;
this.boostTask.cancel();
this.boostSpeedMultiplier = 1;
}