Skip to content

Commit

Permalink
fuel scooping: do not restrict both speed and density
Browse files Browse the repository at this point in the history
It is likely you will scoop successfully if:
1) flying faster through sparse layers of atmosphere
2) flying in dense atmospheres no matter how slow
  • Loading branch information
Mc-Pain committed Sep 20, 2023
1 parent 01566db commit 3aa66cb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Ship.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1256,8 +1256,10 @@ void Ship::StaticUpdate(const float timeStep)
const vector3d vdir = GetVelocity().Normalized();
const vector3d pdir = -GetOrient().VectorZ();
const double dot = vdir.Dot(pdir);
if ((m_stats.free_capacity) && (dot > 0.90) && (speed > 100.0) && (density > 0.3)) {
const double rate = speed * density * 0.00000333 * double(m_stats.fuel_scoop_cap);
const double speed_times_density = speed * density;
// reference: speed > 100.0, density > 0.3
if ((m_stats.free_capacity) && (dot > 0.90) && speed_times_density > (100.0 * 0.3)) {
const double rate = speed_times_density * 0.00000333 * double(m_stats.fuel_scoop_cap);
m_hydrogenScoopedAccumulator += rate * Pi::game->GetTimeAccelRate();
if (m_hydrogenScoopedAccumulator > 1) {
const double scoopedTons = floor(m_hydrogenScoopedAccumulator);
Expand Down

0 comments on commit 3aa66cb

Please sign in to comment.