From 7a5ee8c5f7ec2d13b6d86928436c79648b9f5432 Mon Sep 17 00:00:00 2001 From: Roy Falk Date: Sun, 8 Dec 2024 12:14:43 +0200 Subject: [PATCH] Add comments --- engine/src/components/afterburner.cpp | 2 ++ engine/src/components/drive.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/engine/src/components/afterburner.cpp b/engine/src/components/afterburner.cpp index 57aefb77c7..160afd4b7c 100644 --- a/engine/src/components/afterburner.cpp +++ b/engine/src/components/afterburner.cpp @@ -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; } @@ -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; } diff --git a/engine/src/components/drive.cpp b/engine/src/components/drive.cpp index 64c72cb148..0c3a1aa20b 100644 --- a/engine/src/components/drive.cpp +++ b/engine/src/components/drive.cpp @@ -97,6 +97,7 @@ void Drive::Load(std::string upgrade_key, speed = Resource(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() + @@ -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() +