-
Notifications
You must be signed in to change notification settings - Fork 240
bugfix: Attacking infantry no longer attempt to path to their targets when force-evacuated from a vehicle #3098
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1016,6 +1016,13 @@ void AIStateMachine::clear() | |
| m_goalWaypoint = nullptr; | ||
| m_goalSquad = nullptr; | ||
|
|
||
| #if !RETAIL_COMPATIBLE_CRC | ||
| if (m_temporaryState) | ||
| m_temporaryState->onExit(EXIT_RESET); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any idea if this could also affect some other ai behaviors? State is really vast, used by many different things.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The only other |
||
|
|
||
| m_temporaryState = nullptr; | ||
|
Comment on lines
+1020
to
+1023
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. Temporary state double-exit When !RETAIL_COMPATIBLE_CRC is enabled, AIStateMachine::clear() calls m_temporaryState->onExit(EXIT_RESET) after StateMachine::clear() already exits the current state; because states are singletons per StateID, setting a temporary state to the current StateID would invoke onExit() twice on the same State instance. Agent Prompt
|
||
| #endif | ||
|
|
||
| AIUpdateInterface* ai = getOwner()->getAI(); | ||
| if (ai) | ||
| ai->friend_notifyStateMachineChanged(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1021,6 +1021,13 @@ void AIStateMachine::clear() | |
| m_goalWaypoint = nullptr; | ||
| m_goalSquad = nullptr; | ||
|
|
||
| #if !RETAIL_COMPATIBLE_CRC | ||
| if (m_temporaryState) | ||
| m_temporaryState->onExit(EXIT_RESET); | ||
|
|
||
|
Comment on lines
+1024
to
+1027
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. Evacuation fix behind retail_compatible_crc The new evac/command-responsiveness cleanup that clears m_temporaryState / the AI goal object is wrapped in #if !RETAIL_COMPATIBLE_CRC, but this repo defaults RETAIL_COMPATIBLE_CRC to 1, so default (retail-compatible) builds won’t include the fix and the reported bug may remain. This risks failing the requirement that infantry immediately obey attack commands after emerging from destroyed fireport vehicles. Agent Prompt
|
||
| m_temporaryState = nullptr; | ||
| #endif | ||
|
|
||
| AIUpdateInterface* ai = getOwner()->getAI(); | ||
| if (ai) | ||
| ai->friend_notifyStateMachineChanged(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better also put it behind a PRESERVE_... macro.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't do this because the temporary state reset logic is not necessarily exclusive to the issue at hand. I could make it more broad/generic and have something like
PRESERVE_UNINTERRUPTIBLE_TEMP_AI_STATES, but that's not really indicative of the bug it's targeting.