diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SpawnBehavior.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SpawnBehavior.h index eb043d35121..4ec859c18a5 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SpawnBehavior.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SpawnBehavior.h @@ -122,6 +122,7 @@ class SpawnBehaviorInterface virtual Bool areAllSlavesStealthed() const = 0; virtual void revealSlaves() = 0; virtual Bool doSlavesHaveFreedom() const = 0; + virtual Int getSlaveCount() const = 0; }; // ------------------------------------------------------------------------------------------------ @@ -177,6 +178,7 @@ class SpawnBehavior : public UpdateModule, virtual Bool areAllSlavesStealthed() const override; virtual void revealSlaves() override; virtual Bool doSlavesHaveFreedom() const override { return getSpawnBehaviorModuleData()->m_slavesHaveFreeWill; } + virtual Int getSlaveCount() const override { return m_spawnCount; } // ********************************************************************************************** // our own methods diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp index deef23cd706..86ed3664156 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -74,6 +74,7 @@ #include "GameLogic/Module/AssistedTargetingUpdate.h" #include "GameLogic/Module/ProjectileStreamUpdate.h" #include "GameLogic/Module/PhysicsUpdate.h" +#include "GameLogic/Module/SpawnBehavior.h" #include "GameLogic/TerrainLogic.h" #define RATIONALIZE_ATTACK_RANGE @@ -604,6 +605,15 @@ Real WeaponTemplate::estimateWeaponTemplateDamage( if ( victimObj->getContain()->getContainCount() == 0 ) return 0.0f; } +#if !RETAIL_COMPATIBLE_CRC + else + { + // TheSuperHackers @bugfix Stubbjax 22/06/2026 Only allow targeting Stinger Sites when they contain Soldiers. + SpawnBehaviorInterface* spawnInterface = victimObj->getSpawnBehaviorInterface(); + if (spawnInterface && spawnInterface->getSlaveCount() <= 0) + return 0.0f; + } +#endif }