Skip to content

bugfix: Enter commands are now ignored if the target to enter is invalid or ourselves - #3115

Open
Stubbjax wants to merge 1 commit into
TheSuperHackers:mainfrom
Stubbjax:fix-chinook-enter-behaviour
Open

bugfix: Enter commands are now ignored if the target to enter is invalid or ourselves#3115
Stubbjax wants to merge 1 commit into
TheSuperHackers:mainfrom
Stubbjax:fix-chinook-enter-behaviour

Conversation

@Stubbjax

Copy link
Copy Markdown

This change fixes an issue where grounded Chinooks would take off when receiving invalid enter commands.

Before

When the Chinook is in the selection, an enter command causes it to lift off

BEFORE.mp4
BEFORE.mp4

After

When the Chinook is in the selection, an enter command no longer causes it to lift off

AFTER.mp4
AFTER.mp4

@Stubbjax Stubbjax self-assigned this Aug 12, 2026
@Stubbjax Stubbjax 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 Aug 12, 2026

@Skyaero42 Skyaero42 left a comment

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 looks good to me.

#endif

#if !RETAIL_COMPATIBLE_CRC
// Ignore the command if we are told to enter ourselves (we can be in the same group).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

TheSuperHackers @bugfix

return;

// Ignore the command if we are told to enter something we cannot (we can be in the same group).
if (parms->m_cmd == AICMD_ENTER && !TheActionManager->canEnterObject(getObject(), parms->m_obj, parms->m_cmdSource, DONT_CHECK_CAPACITY))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can merge the parms->m_cmd == AICMD_ENTER condition into one.

Comment on lines +1299 to +1308
#if !RETAIL_COMPATIBLE_CRC
// Ignore the command if we are told to enter ourselves (we can be in the same group).
if (parms->m_cmd == AICMD_ENTER && parms->m_obj && parms->m_obj->getID() == getObject()->getID())
return;

// Ignore the command if we are told to enter something we cannot (we can be in the same group).
if (parms->m_cmd == AICMD_ENTER && !TheActionManager->canEnterObject(getObject(), parms->m_obj, parms->m_cmdSource, DONT_CHECK_CAPACITY))
return;
#endif

@Caball009 Caball009 Aug 12, 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.

Is it possible to put this in a case for AICMD_ENTER in the switch statement below?

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.

4 participants