From 176ff405d362f2b3119bc30f66aa89820e6c15d8 Mon Sep 17 00:00:00 2001 From: githubawn <115191165+githubawn@users.noreply.github.com> Date: Wed, 8 Jul 2026 21:09:25 +0200 Subject: [PATCH 1/6] disable cargo plane alarms --- Core/GameEngine/Include/Common/GameDefines.h | 4 ++++ Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp | 6 +++++- .../Code/GameEngine/Source/GameLogic/Object/Object.cpp | 6 +++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Core/GameEngine/Include/Common/GameDefines.h b/Core/GameEngine/Include/Common/GameDefines.h index 7a6f4be4d11..42fdea36845 100644 --- a/Core/GameEngine/Include/Common/GameDefines.h +++ b/Core/GameEngine/Include/Common/GameDefines.h @@ -27,6 +27,10 @@ #define PRESERVE_BUILDING_RESUMPTION_DELAY (0) // The fix for this unfavorable behavior was approved by the Game Design Committee. #endif +#ifndef PRESERVE_CARGO_PLANE_ATTACK_WARNINGS +#define PRESERVE_CARGO_PLANE_ATTACK_WARNINGS (0) +#endif + #ifndef PRESERVE_CHINOOK_PASSENGER_DUMPING #define PRESERVE_CHINOOK_PASSENGER_DUMPING (1) #endif diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp index 63b25332dc2..5b7f61176bc 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -1769,7 +1769,11 @@ void Object::attemptDamage( DamageInfo *damageInfo ) damageInfo->in.m_damageType != DAMAGE_HEALING && !BitIsSet(damageInfo->in.m_sourcePlayerMask, getControllingPlayer()->getPlayerMask()) && m_radarData != nullptr && - isLocallyControlled() ) + isLocallyControlled() + #if !PRESERVE_CARGO_PLANE_ATTACK_WARNINGS + && getTemplate()->getName() != "AmericaJetCargoPlane" + #endif + ) TheRadar->tryUnderAttackEvent( this ); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp index 8ddeb128638..d1e57e525ca 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -1969,7 +1969,11 @@ void Object::attemptDamage( DamageInfo *damageInfo ) getControllingPlayer() && !BitIsSet(damageInfo->in.m_sourcePlayerMask, getControllingPlayer()->getPlayerMask()) && m_radarData != nullptr && - isLocallyControlled() ) + isLocallyControlled() + #if !PRESERVE_CARGO_PLANE_ATTACK_WARNINGS + && getTemplate()->getName() != "AmericaJetCargoPlane" + #endif + ) TheRadar->tryUnderAttackEvent( this ); } From 2aa7ec60e8ee970e5a3dce0f50cb812aa0589da9 Mon Sep 17 00:00:00 2001 From: githubawn <115191165+githubawn@users.noreply.github.com> Date: Thu, 9 Jul 2026 00:34:01 +0200 Subject: [PATCH 2/6] style(alarm): De-indent preprocessor directives in cargo plane check Preprocessor #if/#endif directives are not allowed indentation in this codebase; align with existing convention in the file. --- Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp | 6 +++--- .../Code/GameEngine/Source/GameLogic/Object/Object.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp index 5b7f61176bc..1492ae4a82a 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -1770,9 +1770,9 @@ void Object::attemptDamage( DamageInfo *damageInfo ) !BitIsSet(damageInfo->in.m_sourcePlayerMask, getControllingPlayer()->getPlayerMask()) && m_radarData != nullptr && isLocallyControlled() - #if !PRESERVE_CARGO_PLANE_ATTACK_WARNINGS - && getTemplate()->getName() != "AmericaJetCargoPlane" - #endif +#if !PRESERVE_CARGO_PLANE_ATTACK_WARNINGS + && getTemplate()->getName() != "AmericaJetCargoPlane" +#endif ) TheRadar->tryUnderAttackEvent( this ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp index d1e57e525ca..e05dedddc24 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -1970,9 +1970,9 @@ void Object::attemptDamage( DamageInfo *damageInfo ) !BitIsSet(damageInfo->in.m_sourcePlayerMask, getControllingPlayer()->getPlayerMask()) && m_radarData != nullptr && isLocallyControlled() - #if !PRESERVE_CARGO_PLANE_ATTACK_WARNINGS - && getTemplate()->getName() != "AmericaJetCargoPlane" - #endif +#if !PRESERVE_CARGO_PLANE_ATTACK_WARNINGS + && getTemplate()->getName() != "AmericaJetCargoPlane" +#endif ) TheRadar->tryUnderAttackEvent( this ); From 64594965288a7cd4431b03515c3d055035f2d533 Mon Sep 17 00:00:00 2001 From: githubawn <115191165+githubawn@users.noreply.github.com> Date: Wed, 15 Jul 2026 19:46:36 +0200 Subject: [PATCH 3/6] Replace cargo plane name check with NO_ATTACK_WARNING KindOf --- Core/GameEngine/Include/Common/GameDefines.h | 4 ---- Generals/Code/GameEngine/Include/Common/KindOf.h | 2 ++ Generals/Code/GameEngine/Source/Common/System/KindOf.cpp | 1 + .../Code/GameEngine/Source/GameLogic/Object/Object.cpp | 7 ++----- GeneralsMD/Code/GameEngine/Include/Common/KindOf.h | 2 ++ GeneralsMD/Code/GameEngine/Source/Common/System/KindOf.cpp | 1 + .../Code/GameEngine/Source/GameLogic/Object/Object.cpp | 7 ++----- 7 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Core/GameEngine/Include/Common/GameDefines.h b/Core/GameEngine/Include/Common/GameDefines.h index 42fdea36845..7a6f4be4d11 100644 --- a/Core/GameEngine/Include/Common/GameDefines.h +++ b/Core/GameEngine/Include/Common/GameDefines.h @@ -27,10 +27,6 @@ #define PRESERVE_BUILDING_RESUMPTION_DELAY (0) // The fix for this unfavorable behavior was approved by the Game Design Committee. #endif -#ifndef PRESERVE_CARGO_PLANE_ATTACK_WARNINGS -#define PRESERVE_CARGO_PLANE_ATTACK_WARNINGS (0) -#endif - #ifndef PRESERVE_CHINOOK_PASSENGER_DUMPING #define PRESERVE_CHINOOK_PASSENGER_DUMPING (1) #endif diff --git a/Generals/Code/GameEngine/Include/Common/KindOf.h b/Generals/Code/GameEngine/Include/Common/KindOf.h index 6bcf42f36f0..e68bce27d95 100644 --- a/Generals/Code/GameEngine/Include/Common/KindOf.h +++ b/Generals/Code/GameEngine/Include/Common/KindOf.h @@ -171,6 +171,8 @@ enum KindOfType CPP_11(: Int) KINDOF_DEMOTRAP, ///< Added strictly only for disarming purposes. They don't act like mines which have rendering and selection implications! KINDOF_CONSERVATIVE_BUILDING, ///< Conservative structures aren't considered part of your base for sneak attack boundary calculations... KINDOF_IGNORE_DOCKING_BONES, ///< Structure will not look up docking bones. Patch 1.03 hack. + // TheSuperHackers @info TSH Kindofs + KINDOF_NO_ATTACK_WARNING, ///< does not trigger the under attack radar/EVA warning when damaged (e.g. cargo planes) KINDOF_COUNT, // total number of kindofs KINDOF_FIRST = 0, diff --git a/Generals/Code/GameEngine/Source/Common/System/KindOf.cpp b/Generals/Code/GameEngine/Source/Common/System/KindOf.cpp index e5c20d2cfb2..eeaf355d1c3 100644 --- a/Generals/Code/GameEngine/Source/Common/System/KindOf.cpp +++ b/Generals/Code/GameEngine/Source/Common/System/KindOf.cpp @@ -161,6 +161,7 @@ const char* const KindOfMaskType::s_bitNameList[] = "DEMOTRAP", "CONSERVATIVE_BUILDING", "IGNORE_DOCKING_BONES", + "NO_ATTACK_WARNING", nullptr }; diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp index 1492ae4a82a..55770f4ea0d 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -1769,11 +1769,8 @@ void Object::attemptDamage( DamageInfo *damageInfo ) damageInfo->in.m_damageType != DAMAGE_HEALING && !BitIsSet(damageInfo->in.m_sourcePlayerMask, getControllingPlayer()->getPlayerMask()) && m_radarData != nullptr && - isLocallyControlled() -#if !PRESERVE_CARGO_PLANE_ATTACK_WARNINGS - && getTemplate()->getName() != "AmericaJetCargoPlane" -#endif - ) + isLocallyControlled() && + !isKindOf( KINDOF_NO_ATTACK_WARNING ) ) TheRadar->tryUnderAttackEvent( this ); } diff --git a/GeneralsMD/Code/GameEngine/Include/Common/KindOf.h b/GeneralsMD/Code/GameEngine/Include/Common/KindOf.h index 8c0956d038a..a9ef92b4371 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/KindOf.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/KindOf.h @@ -171,6 +171,8 @@ enum KindOfType CPP_11(: Int) KINDOF_DEMOTRAP, ///< Added strictly only for disarming purposes. They don't act like mines which have rendering and selection implications! KINDOF_CONSERVATIVE_BUILDING, ///< Conservative structures aren't considered part of your base for sneak attack boundary calculations... KINDOF_IGNORE_DOCKING_BONES, ///< Structure will not look up docking bones. Patch 1.03 hack. + // TheSuperHackers @info TSH Kindofs + KINDOF_NO_ATTACK_WARNING, ///< does not trigger the under attack radar/EVA warning when damaged (e.g. cargo planes) KINDOF_COUNT, // total number of kindofs KINDOF_FIRST = 0, diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/KindOf.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/KindOf.cpp index fab350e998d..52dfb55658d 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/KindOf.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/KindOf.cpp @@ -161,6 +161,7 @@ const char* const KindOfMaskType::s_bitNameList[] = "DEMOTRAP", "CONSERVATIVE_BUILDING", "IGNORE_DOCKING_BONES", + "NO_ATTACK_WARNING", nullptr }; diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp index e05dedddc24..5c35b57b38d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -1969,11 +1969,8 @@ void Object::attemptDamage( DamageInfo *damageInfo ) getControllingPlayer() && !BitIsSet(damageInfo->in.m_sourcePlayerMask, getControllingPlayer()->getPlayerMask()) && m_radarData != nullptr && - isLocallyControlled() -#if !PRESERVE_CARGO_PLANE_ATTACK_WARNINGS - && getTemplate()->getName() != "AmericaJetCargoPlane" -#endif - ) + isLocallyControlled() && + !isKindOf( KINDOF_NO_ATTACK_WARNING ) ) TheRadar->tryUnderAttackEvent( this ); } From 9631808d0709013f320c34dd7c40a6e89fdc994f Mon Sep 17 00:00:00 2001 From: githubawn <115191165+githubawn@users.noreply.github.com> Date: Wed, 15 Jul 2026 20:09:03 +0200 Subject: [PATCH 4/6] Add unused KindOf padding bit to fix duplicate symbol link error --- GeneralsMD/Code/GameEngine/Include/Common/KindOf.h | 1 + GeneralsMD/Code/GameEngine/Source/Common/System/KindOf.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/GeneralsMD/Code/GameEngine/Include/Common/KindOf.h b/GeneralsMD/Code/GameEngine/Include/Common/KindOf.h index a9ef92b4371..7370aaaeb17 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/KindOf.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/KindOf.h @@ -173,6 +173,7 @@ enum KindOfType CPP_11(: Int) KINDOF_IGNORE_DOCKING_BONES, ///< Structure will not look up docking bones. Patch 1.03 hack. // TheSuperHackers @info TSH Kindofs KINDOF_NO_ATTACK_WARNING, ///< does not trigger the under attack radar/EVA warning when damaged (e.g. cargo planes) + KINDOF_UNUSED_1, ///< padding to keep KINDOF_COUNT off other BitFlags counts, replace with the next new kindof KINDOF_COUNT, // total number of kindofs KINDOF_FIRST = 0, diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/KindOf.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/KindOf.cpp index 52dfb55658d..08b736c4f57 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/KindOf.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/KindOf.cpp @@ -162,6 +162,7 @@ const char* const KindOfMaskType::s_bitNameList[] = "CONSERVATIVE_BUILDING", "IGNORE_DOCKING_BONES", "NO_ATTACK_WARNING", + "UNUSED_1", nullptr }; From aeb212799f1451cbb8b9c7d248d05b7d50990ea6 Mon Sep 17 00:00:00 2001 From: githubawn <115191165+githubawn@users.noreply.github.com> Date: Fri, 31 Jul 2026 23:26:37 +0200 Subject: [PATCH 5/6] style(kindof): Update KindOf comment and remove obsolete UNUSED_1 padding bit --- Generals/Code/GameEngine/Include/Common/KindOf.h | 4 +++- GeneralsMD/Code/GameEngine/Include/Common/KindOf.h | 5 +++-- GeneralsMD/Code/GameEngine/Source/Common/System/KindOf.cpp | 1 - 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Generals/Code/GameEngine/Include/Common/KindOf.h b/Generals/Code/GameEngine/Include/Common/KindOf.h index e68bce27d95..c6a0db48b57 100644 --- a/Generals/Code/GameEngine/Include/Common/KindOf.h +++ b/Generals/Code/GameEngine/Include/Common/KindOf.h @@ -171,7 +171,9 @@ enum KindOfType CPP_11(: Int) KINDOF_DEMOTRAP, ///< Added strictly only for disarming purposes. They don't act like mines which have rendering and selection implications! KINDOF_CONSERVATIVE_BUILDING, ///< Conservative structures aren't considered part of your base for sneak attack boundary calculations... KINDOF_IGNORE_DOCKING_BONES, ///< Structure will not look up docking bones. Patch 1.03 hack. - // TheSuperHackers @info TSH Kindofs + + // TheSuperHackers @info New kinds for Mods + KINDOF_NO_ATTACK_WARNING, ///< does not trigger the under attack radar/EVA warning when damaged (e.g. cargo planes) KINDOF_COUNT, // total number of kindofs diff --git a/GeneralsMD/Code/GameEngine/Include/Common/KindOf.h b/GeneralsMD/Code/GameEngine/Include/Common/KindOf.h index 7370aaaeb17..6c0e78251da 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/KindOf.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/KindOf.h @@ -171,9 +171,10 @@ enum KindOfType CPP_11(: Int) KINDOF_DEMOTRAP, ///< Added strictly only for disarming purposes. They don't act like mines which have rendering and selection implications! KINDOF_CONSERVATIVE_BUILDING, ///< Conservative structures aren't considered part of your base for sneak attack boundary calculations... KINDOF_IGNORE_DOCKING_BONES, ///< Structure will not look up docking bones. Patch 1.03 hack. - // TheSuperHackers @info TSH Kindofs + + // TheSuperHackers @info New kinds for Mods + KINDOF_NO_ATTACK_WARNING, ///< does not trigger the under attack radar/EVA warning when damaged (e.g. cargo planes) - KINDOF_UNUSED_1, ///< padding to keep KINDOF_COUNT off other BitFlags counts, replace with the next new kindof KINDOF_COUNT, // total number of kindofs KINDOF_FIRST = 0, diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/KindOf.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/KindOf.cpp index 08b736c4f57..52dfb55658d 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/KindOf.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/KindOf.cpp @@ -162,7 +162,6 @@ const char* const KindOfMaskType::s_bitNameList[] = "CONSERVATIVE_BUILDING", "IGNORE_DOCKING_BONES", "NO_ATTACK_WARNING", - "UNUSED_1", nullptr }; From 3cb5ecb2cbad7bd80f38bed2a8d097de935b7597 Mon Sep 17 00:00:00 2001 From: githubawn <115191165+githubawn@users.noreply.github.com> Date: Fri, 31 Jul 2026 23:34:10 +0200 Subject: [PATCH 6/6] update comment --- Generals/Code/GameEngine/Include/Common/KindOf.h | 2 +- GeneralsMD/Code/GameEngine/Include/Common/KindOf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Generals/Code/GameEngine/Include/Common/KindOf.h b/Generals/Code/GameEngine/Include/Common/KindOf.h index c6a0db48b57..9cae1a51c31 100644 --- a/Generals/Code/GameEngine/Include/Common/KindOf.h +++ b/Generals/Code/GameEngine/Include/Common/KindOf.h @@ -174,7 +174,7 @@ enum KindOfType CPP_11(: Int) // TheSuperHackers @info New kinds for Mods - KINDOF_NO_ATTACK_WARNING, ///< does not trigger the under attack radar/EVA warning when damaged (e.g. cargo planes) + KINDOF_NO_ATTACK_WARNING, ///< does not trigger the under attack radar/EVA warning when taking damage KINDOF_COUNT, // total number of kindofs KINDOF_FIRST = 0, diff --git a/GeneralsMD/Code/GameEngine/Include/Common/KindOf.h b/GeneralsMD/Code/GameEngine/Include/Common/KindOf.h index 6c0e78251da..9c06da48be0 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/KindOf.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/KindOf.h @@ -174,7 +174,7 @@ enum KindOfType CPP_11(: Int) // TheSuperHackers @info New kinds for Mods - KINDOF_NO_ATTACK_WARNING, ///< does not trigger the under attack radar/EVA warning when damaged (e.g. cargo planes) + KINDOF_NO_ATTACK_WARNING, ///< does not trigger the under attack radar/EVA warning when taking damage KINDOF_COUNT, // total number of kindofs KINDOF_FIRST = 0,