This commit is contained in:
Anuken
2021-01-14 11:26:16 -05:00
parent 95c04eb085
commit 32070a37f7

View File

@@ -175,11 +175,14 @@ public class MassDriver extends Block{
Angles.near(rotation, targetRotation, 2f) && Angles.near(other.rotation, targetRotation + 180f, 2f)){ Angles.near(rotation, targetRotation, 2f) && Angles.near(other.rotation, targetRotation + 180f, 2f)){
//actually fire //actually fire
fire(other); fire(other);
//remove waiting shooters, it's done firing float timeToArrive = Math.min(bulletLifetime, dst(other) / bulletSpeed);
other.waitingShooters.remove(tile); Time.run(timeToArrive, () -> {
//set both states to idle //remove waiting shooters, it's done firing
other.waitingShooters.remove(tile);
other.state = DriverState.idle;
});
//driver is immediately idle
state = DriverState.idle; state = DriverState.idle;
other.state = DriverState.idle;
} }
} }
} }