//------------------------------------------------------------------------ void CVehicleMountedWeapon::SetInventoryAmmoCount(IEntityClass* pAmmoType, int count) { IActor* pOwner = GetOwnerActor(); IVehicle *pVehicle = gEnv->pGame->GetIGameFramework()->GetIVehicleSystem()->GetVehicle(m_vehicleId); if (pVehicle && pOwner && !pOwner->IsPlayer()) { if (count < pVehicle->GetAmmoCount(pAmmoType)) return; } CHeavyMountedWeapon::SetInventoryAmmoCount(pAmmoType, count); }
//------------------------------------------------------------------------ void CVehicleWeapon::SetInventoryAmmoCount(IEntityClass* pAmmoType, int count) { IActor* pOwner = GetOwnerActor(); if (pOwner && !pOwner->IsPlayer()) { IVehicle* pVehicle = GetVehicle(); if (pVehicle && count < pVehicle->GetAmmoCount(pAmmoType)) return; } CWeapon::SetInventoryAmmoCount(pAmmoType, count); }