Skip to content

[GEN][ZH] Fix supply drops instantly triggering when subdued while under construction #1281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Mauller
Copy link

@Mauller Mauller commented Jul 14, 2025

This PR is an alternate / updated implementation of an earlier orphaned PR

This PR prevents supply drops from instantly triggering when they were being subdued while under construction.
The issue stems from m_nextCreationFrame being incremented while the building is disabled.

If the building is still subdued when transitioning from under construction to constructed, the above occurs before the timer gets inintialised inside the early return within the if( m_nextCreationFrame == 0 ) block.
This results in the shouldCreate() block getting fully triggered and a supply drop being created

This PR also adds the subdual behaviour in a non retail block to the generals variant of the code as it was missing before.

@Mauller Mauller self-assigned this Jul 14, 2025
@Mauller Mauller added Bug Something is not working right, typically is user facing 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 Jul 14, 2025
@Mauller Mauller added this to the Major bug fixes milestone Jul 14, 2025
@Caball009
Copy link

Caball009 commented Jul 15, 2025

This fixes the issue but doesn't fix the timer if the building is still subdued when construction finishes. As far as I can tell this is only a visual bug, and as soon as the microwave tank stops the attack, the timer starts to count down from 2 minutes like normal. I don't know what happens if this timer reaches 0.

image

@Mauller
Copy link
Author

Mauller commented Jul 15, 2025

This fixes the issue but doesn't fix the timer if the building is still subdued when construction finishes. As far as I can tell this is only a visual bug, and as soon as the microwave tank stops the attack, the timer starts to count down from 2 minutes like normal. I don't know what happens if this timer reaches 0.
image

It's just a visual glitch, the moment the building is released from being subdued the timer gets initialised properly.

@Caball009
Copy link

It's just a visual glitch, the moment the building is released from being subdued the timer gets initialised properly.

There's also a divide by float 0, which is unfortunate. I'm going to check it out. I think it can be avoided.

@Mauller Mauller force-pushed the fix-supply-drop-glitch branch from 8be7806 to fab3c9b Compare July 15, 2025 18:34
@Mauller
Copy link
Author

Mauller commented Jul 15, 2025

Tweaked so the disabling code in generals version is just the fixed code and all behind a non retail compatible include

@Mauller Mauller force-pushed the fix-supply-drop-glitch branch from fab3c9b to f3b12d8 Compare July 15, 2025 19:08
@Mauller
Copy link
Author

Mauller commented Jul 15, 2025

Updated with the recent recommendations, works as expected and also prevents some visual and division issues.

Copy link

@Caball009 Caball009 left a comment

Choose a reason for hiding this comment

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

Looks good.

@Mauller Mauller force-pushed the fix-supply-drop-glitch branch from f3b12d8 to 46759a4 Compare July 15, 2025 19:17
@Mauller
Copy link
Author

Mauller commented Jul 15, 2025

Fudged spelling in the comments.

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 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.

USA supply drop zone exploit
3 participants