Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
royfalk committed Dec 8, 2024
1 parent cc9d5ad commit 7a5ee8c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions engine/src/components/afterburner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ void Afterburner::Load(std::string upgrade_key,
double consumption = UnitCSVFactory::GetVariable(unit_key, "Afterburner_Usage_Cost", 1.0);
SetConsumption(consumption);

// We calculate percent operational as a simple average
operational = (thrust.Percent() + speed.Percent()) / 2 * 100;
}

Expand Down Expand Up @@ -81,6 +82,7 @@ void Afterburner::Damage() {
thrust.RandomDamage();
speed.RandomDamage();

// We calculate percent operational as a simple average
operational = (thrust.Percent() + speed.Percent()) / 2 * 100;
}

Expand Down
2 changes: 2 additions & 0 deletions engine/src/components/drive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ void Drive::Load(std::string upgrade_key,
speed = Resource<double>(UnitCSVFactory::GetVariable(unit_key, "Default_Speed_Governor", std::string("0.0")),
game_speed, minimal_drive_functionality);

// We calculate percent operational as a simple average
operational = (yaw.Percent() + pitch.Percent() + roll.Percent() +
lateral.Percent() + vertical.Percent() + forward.Percent() +
retro.Percent() + speed.Percent() +
Expand Down Expand Up @@ -170,6 +171,7 @@ void Drive::Damage() {
max_roll_left.RandomDamage();
max_roll_right.RandomDamage();

// We calculate percent operational as a simple average
operational = (yaw.Percent() + pitch.Percent() + roll.Percent() +
lateral.Percent() + vertical.Percent() + forward.Percent() +
retro.Percent() + speed.Percent() +
Expand Down

0 comments on commit 7a5ee8c

Please sign in to comment.