Skip to content

Commit

Permalink
Update Armament.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
warp-core committed Apr 5, 2024
1 parent 4accbf4 commit a262ddc
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions source/Armament.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,23 +370,21 @@ void Armament::Fire(unsigned index, Ship &ship, vector<Projectile> &projectiles,
if(!CheckHardpoint(index))
return;

auto &hp = hardpoints[index];

// A weapon that has already started a burst ignores stream timing.
if(!hp.WasFiring())
if(!hardpoints[index].WasFiring())
{
auto it = streamReload.find(hp.GetOutfit());
auto it = streamReload.find(hardpoints[index].GetOutfit());
if(it != streamReload.end())
{
if(it->second > 0)
return;
it->second += it->first->Reload() * hp.BurstRemaining();
it->second += it->first->Reload() * hardpoints[index].BurstRemaining();
}
}
if(jammed)
hp.Jam();
hardpoints[index].Jam();
else
hp.Fire(ship, projectiles, visuals);
hardpoints[index].Fire(ship, projectiles, visuals);
}


Expand All @@ -397,15 +395,13 @@ bool Armament::FireAntiMissile(unsigned index, Ship &ship, const Projectile &pro
if(!CheckHardpoint(index, jammed))
return false;

auto &hp = hardpoints[index];

if(jammed)
{
hp.Jam();
hardpoints[index].Jam();
return false;
}

return hp.FireAntiMissile(ship, projectile, visuals);
return hardpoints[index].FireAntiMissile(ship, projectile, visuals);
}


Expand Down

0 comments on commit a262ddc

Please sign in to comment.