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)){
//actually fire
fire(other);
//remove waiting shooters, it's done firing
other.waitingShooters.remove(tile);
//set both states to idle
float timeToArrive = Math.min(bulletLifetime, dst(other) / bulletSpeed);
Time.run(timeToArrive, () -> {
//remove waiting shooters, it's done firing
other.waitingShooters.remove(tile);
other.state = DriverState.idle;
});
//driver is immediately idle
state = DriverState.idle;
other.state = DriverState.idle;
}
}
}