bugfix: Prevent fallen Angry Mob members respawning at the Barracks after loading a save#2314
Conversation
…fter loading a save
|
| Filename | Overview |
|---|---|
| Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/SpawnBehavior.cpp | Added serialization for m_initialBurstCountdown with version 3, using RETAIL_COMPATIBLE_XFER_SAVE guard to maintain save compatibility |
| GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/SpawnBehavior.cpp | Added serialization for m_initialBurstCountdown with version 3, using RETAIL_COMPATIBLE_XFER_SAVE guard to maintain save compatibility |
Last reviewed commit: 23304a3
| if (version >= 3) | ||
| xfer->xferUnsignedInt(&m_initialBurstCountdown); |
There was a problem hiding this comment.
Inconsistent brace style with surrounding code (line 1007-1009 uses braces)
| if (version >= 3) | |
| xfer->xferUnsignedInt(&m_initialBurstCountdown); | |
| if (version >= 3) { | |
| xfer->xferUnsignedInt(&m_initialBurstCountdown); | |
| } |
Context Used: Rule from dashboard - Always place if/else/for/while statement bodies on separate lines from the condition to allow precis... (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/SpawnBehavior.cpp
Line: 1011:1012
Comment:
Inconsistent brace style with surrounding code (line 1007-1009 uses braces)
```suggestion
if (version >= 3) {
xfer->xferUnsignedInt(&m_initialBurstCountdown);
}
```
**Context Used:** Rule from `dashboard` - Always place if/else/for/while statement bodies on separate lines from the condition to allow precis... ([source](https://app.greptile.com/review/custom-context?memory=16b9b669-b823-49be-ba5b-2bd30ff3ba6d))
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.| if (version >= 3) | ||
| xfer->xferUnsignedInt(&m_initialBurstCountdown); |
There was a problem hiding this comment.
Inconsistent brace style with surrounding code (line 1092-1094 uses braces)
| if (version >= 3) | |
| xfer->xferUnsignedInt(&m_initialBurstCountdown); | |
| if (version >= 3) { | |
| xfer->xferUnsignedInt(&m_initialBurstCountdown); | |
| } |
Context Used: Rule from dashboard - Always place if/else/for/while statement bodies on separate lines from the condition to allow precis... (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/SpawnBehavior.cpp
Line: 1096:1097
Comment:
Inconsistent brace style with surrounding code (line 1092-1094 uses braces)
```suggestion
if (version >= 3) {
xfer->xferUnsignedInt(&m_initialBurstCountdown);
}
```
**Context Used:** Rule from `dashboard` - Always place if/else/for/while statement bodies on separate lines from the condition to allow precis... ([source](https://app.greptile.com/review/custom-context?memory=16b9b669-b823-49be-ba5b-2bd30ff3ba6d))
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.|
Question: Are they supposed to respawn at all? |
Yes; see |
This change fixes an issue where fallen Angry Mob members respawn at the Barracks after loading a save.
Angry Mob members spawn from the Barracks if
m_initialBurstCountdownis greater than 0. Asm_initialBurstCountdownis not saved in the retail game, it is always reset to its default/retail value of 5 when loading a saved game. This results in up to 5 Angry Mob members respawning from the Barracks and attempting to run across the map to join the nexus, where they often die again in the process due to being too far away.Before
Fallen Angry Mob members respawn at the Barracks
BAD_SPAWN.mp4
After
Fallen Angry Mob members respawn at the nexus
GOOD_SPAWN.mp4