reload bug fixed

master
Vectozavr 2021-10-26 19:38:07 +07:00
parent 217a5ba4e1
commit 31722ca109
1 changed files with 4 additions and 0 deletions

View File

@ -34,6 +34,10 @@ FireInformation Weapon::fire(std::function<IntersectionInformation(const Vec3D&,
_lastFireTime = Time::time(); _lastFireTime = Time::time();
_clipAmmo--; _clipAmmo--;
if(_clipAmmo == 0) {
reload();
}
SoundController::playSound(SoundTag("fire"), fireSound); SoundController::playSound(SoundTag("fire"), fireSound);
Log::log("Weapon::fire (" + std::to_string(_stockAmmo) + " : " + std::to_string(_clipAmmo) + ")"); Log::log("Weapon::fire (" + std::to_string(_stockAmmo) + " : " + std::to_string(_clipAmmo) + ")");