Skip to content

Commit

Permalink
ec pershot logic
Browse files Browse the repository at this point in the history
  • Loading branch information
gomker committed Jul 8, 2018
1 parent 8146622 commit 9a9b7af
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions BDArmory/ModuleWeapon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1457,18 +1457,19 @@ void DrainECPerShot()

bool CanFire()
{
if ((BDArmorySettings.INFINITE_AMMO || part.RequestResource(ammoName, requestResourceAmount) > 0))

if (ECPerShot != 0)
{
if (ECPerShot != 0)
double chargeAvailable = part.RequestResource("ElectricCharge", ECPerShot, ResourceFlowMode.ALL_VESSEL);
if (chargeAvailable < ECPerShot * 0.95f)
{
double chargeAvailable = part.RequestResource("ElectricCharge", ECPerShot, ResourceFlowMode.ALL_VESSEL);
if (chargeAvailable < ECPerShot * 0.95f)
{
ScreenMessages.PostScreenMessage("Weapon Requires EC", 5.0f, ScreenMessageStyle.UPPER_CENTER);
return false;
}
ScreenMessages.PostScreenMessage("Weapon Requires EC", 5.0f, ScreenMessageStyle.UPPER_CENTER);
return false;
}
}

if ((BDArmorySettings.INFINITE_AMMO || part.RequestResource(ammoName, requestResourceAmount) > 0))
{
return true;
}

Expand Down

0 comments on commit 9a9b7af

Please sign in to comment.