Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

// ------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -604,6 +605,15 @@ Real WeaponTemplate::estimateWeaponTemplateDamage(
if ( victimObj->getContain()->getContainCount() == 0 )
return 0.0f;
}
#if !RETAIL_COMPATIBLE_CRC

@Skyaero42 Skyaero42 Jun 23, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may also need a PRESERVE_SNIPER_STINGER_BEHAVIOR flag
The fix significantly increases the effectiveness of the sniper against GLA bases.
May need to be checked with The Counsel

else

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? Are Contain and SpawnBehavior mutually exclusive always forever?

Maybe check if Contain count + Slave count are zero?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should be too concerned about posterity here given the whole block (DAMAGE_SNIPER vs KINDOF_STRUCTURE) is a special-case hack in the first place.

The whole thing falls apart as soon as you attempt other configurations, e.g. having a KINDOF_STRUCTURE hive/container with KINDOF_VEHICLE slaves and attempting to fire a SUBDUAL_VEHICLE-damage weapon on the structure.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it take to fix it properly with no hacking?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd probably have to check whether the container encloses the occupants (i.e. in a similar way to how Propaganda can affect Fire Base occupants but not Bunker occupants) and then determine whether the armour of any of the occupants is > 0% for the respective weapon being used.

But that'd be a bigger endeavour/refactor that is out of scope for this change.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok maybe we can make the proper fix and then close this one.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incremental improvements are fine.

{
// 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
}


Expand Down
Loading