Fixed unarmed ground units not moving

This commit is contained in:
Pax1601 2025-07-29 17:17:15 +02:00 committed by GitHub
parent fd72d4ae2d
commit de1f233848
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -179,10 +179,9 @@ void GroundUnit::AIloop()
double currentAmmo = computeTotalAmmo();
/* Out of ammo */
if (currentAmmo <= shotsToFire && state != State::IDLE) {
if (shotsToFire > 0 && currentAmmo < shotsToFire && state != State::IDLE && state != State::REACH_DESTINATION)
setState(State::IDLE);
}
/* Account for unit reloading */
if (currentAmmo < oldAmmo)
totalShellsFired += oldAmmo - currentAmmo;