Skip to content

Conversation

xezon
Copy link

@xezon xezon commented Sep 20, 2025

This fix is an alternative to #1545 and fixes the unexpected propaganda influence from contained units with direct Propaganda Tower behavior modules.

TODO

  • Replicate in Generals

…units with direct Propaganda Tower behavior modules
@xezon xezon added Bug Something is not working right, typically is user facing China Affects China faction Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour NoRetail This fix or change is not applicable with Retail game compatibility labels Sep 20, 2025
Comment on lines +443 to +444
Object *getContainedBySpecialOverlordStyle(); ///< Get parent container object if its contain module is Overlord style.
const Object *getContainedBySpecialOverlordStyle() const; ///< Get parent container object if its contain module is Overlord style.

Choose a reason for hiding this comment

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

Is the Object class the best place for these functions? It feels backwards to put specific behaviour here (despite most of the code base already breaking this principle).

Copy link
Author

Choose a reason for hiding this comment

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

Do you have suggestion where to put it?

Choose a reason for hiding this comment

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

Ideally the container should be aware of whether its occupants are exposed / visible (I believe isEnclosingContainerFor might typically be used for this purpose). This would then allow all non-enclosed contained objects to provide their Propaganda effects, such as infantry in a Firebase if the PropagandaTowerBehavior module were to be added to them.

Copy link
Author

Choose a reason for hiding this comment

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

I do not know what you mean. Please create a new Pull if there is another different fix proposal.

Choose a reason for hiding this comment

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

Creating endless fix proposals is inefficient over simply discussing the solution. Which parts are unclear?

If #1545 is not generic enough then I suggest this change is not either. The ideal solution also supports infantry with PropagandaTowerBehavior modules in Firebases.

Copy link
Author

Choose a reason for hiding this comment

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

Ok, how would the test for that look like?

Choose a reason for hiding this comment

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

You would copy any PropagandaTowerBehavior module from an applicable China object (e.g. from ChinaTankOverlordPropagandaTower in ChinaVehicle.ini) and add it to any USA infantry unit (e.g. to AmericaInfantryRanger in AmericaInfantry.ini). Also ensure the module name ModuleTag_XX is unique.

Then start a new game as USA and build the respective infantry unit, which should now be producing an observable Propaganda effect. Build a Firebase and garrison the infantry unit within the Firebase. If the Propaganda effect turns off when the infantry unit is garrisoned, then the solution is inadequate and we lose functionality from retail.

Copy link
Author

Choose a reason for hiding this comment

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

I meant how would the test in C++ look like. The if condition for testing the container.

Choose a reason for hiding this comment

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

There is a field on the GarrisonContain module - IsEnclosingContainer that is set to false for the Firebase (and dynamically returned for OverlordContain::isEnclosingContainerFor). Perhaps similar logic is needed in this case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working right, typically is user facing China Affects China faction Gen Relates to Generals Minor Severity: Minor < Major < Critical < Blocker NoRetail This fix or change is not applicable with Retail game compatibility ZH Relates to Zero Hour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants