void execute(CItem *_this) { CShotgun *fm = (CShotgun *)pWep->GetFireMode(pWep->GetCurrentFireMode()); if(fm->m_reload_was_broken) return; IEntityClass *pAmmoType = fm->GetAmmoType(); if(pWep->IsServer()) { const int ammoCount = pWep->GetAmmoCount(pAmmoType); const int inventoryCount = pWep->GetInventoryAmmoCount(pAmmoType); const int refill = fm->m_pShared->shotgunparams.partial_reload ? 1 : min(inventoryCount, fm->GetClipSize() - ammoCount); pWep->SetAmmoCount(pAmmoType, ammoCount + refill); pWep->SetInventoryAmmoCount(pAmmoType, pWep->GetInventoryAmmoCount(pAmmoType) - refill); } g_pGame->GetIGameFramework()->GetIGameplayRecorder()->Event(pWep->GetOwner(), GameplayEvent(eGE_WeaponReload, pAmmoType->GetName(), 1, (void *)(pWep->GetEntityId()))); if(!fm->m_break_reload) fm->ReloadShell(rzoomed); else fm->EndReload(rzoomed); }
void execute(CItem *_this) { CShotgun *fm = (CShotgun *)pWep->GetFireMode(pWep->GetCurrentFireMode()); IEntityClass* ammo = fm->GetAmmoType(); pWep->OnEndReload(pWep->GetOwnerId(), ammo); pWep->SetBusy(false); fm->m_reloading = false; fm->m_emptyclip = false; fm->m_spinUpTime = fm->m_firing ? fm->m_fireParams->fireparams.spin_up_time:0.0f; if (fm->m_break_reload) { fm->m_break_reload=false; } else if(fm->m_load_shell_on_end && pWep->IsServer()) { IEntityClass* pAmmoType = fm->GetAmmoType(); const int ammoCount = pWep->GetAmmoCount(pAmmoType); const int inventoryCount = pWep->GetInventoryAmmoCount(pAmmoType); pWep->SetAmmoCount(pAmmoType, ammoCount + 1); pWep->SetInventoryAmmoCount(pAmmoType, inventoryCount - 1); fm->m_load_shell_on_end = false; } }
void execute(CItem *_this) { CShotgun *fm = (CShotgun *)pWep->GetFireMode(pWep->GetCurrentFireMode()); IEntityClass *ammo = fm->GetAmmoType(); pWep->OnEndReload(pWep->GetOwnerId(), ammo); fm->m_reloading = false; fm->m_emptyclip = false; fm->m_spinUpTime = fm->m_firing?fm->m_pShared->fireparams.spin_up_time:0.0f; if(fm->m_break_reload) { fm->Shoot(true, true); fm->m_break_reload=false; } else if(fm->m_reload_was_broken) { if(pWep->GetOwnerActor() && pWep->GetOwnerActor()->IsClient()) pWep->MeleeAttack(); } }
void execute(CItem *_this) { shotty->ReloadShell(zoomed); }