From 889db34f9b64dd9242ff56d3ad426f472079cb8d 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/4] 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 1bf9f096fcf..cdf3af4c732 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 461e3495539..36b563d8734 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -1760,7 +1760,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 0bd898aae75..86527ce3199 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -1960,7 +1960,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 acf520811faf1db2993331bbbd2b0a61d6864c6e 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/4] 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 36b563d8734..28eea4f43b6 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -1761,9 +1761,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 86527ce3199..239267d17fc 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -1961,9 +1961,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 293c364fd0ef48e65dee50fc52584813200bb460 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/4] 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 cdf3af4c732..1bf9f096fcf 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 a7563273efa..f1ca7742626 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 28eea4f43b6..88de0177ea0 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -1760,11 +1760,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 a81d4e62870..b48c925ce49 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 239267d17fc..bebf68a2d70 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -1960,11 +1960,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 59f89dbe74f4a633dec3c1e45f691906f791034e 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/4] 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 b48c925ce49..7f6784dc2e9 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 };