Пример #1
0
//------------------------------------------------------------------------
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);
}
Пример #2
0
//------------------------------------------------------------------------
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);
}