sources » TechnoClass » Reload
void TechnoClass::Reload() {
MaxAmmo = this->GetType()->Ammo;
if ( MaxAmmo != -1 ) {
curAmmo = this->currentAmmo;
if ( curAmmo < result ) {
reloadStart = this->ReloadTimer.StartingFrame;
reloadDuration = this->ReloadTimer.Duration;
if ( reloadStart != -1 ) {
if ( CurrentFrame - reloadStart >= reloadDuration ) {
this->currentAmmo = curAmmo + 1;
this->ForceLayer(LAYER_GROUND);
TechnoClass::Update_Reloading(this);
return;
}
reloadDuration -= CurrentFrame - reloadStart;
}
if ( reloadDuration != 0 )
return;
this->currentAmmo = curAmmo + 1;
this->ForceLayer(LAYER_GROUND);
TechnoClass::Update_Reloading(this);
}
}
}