-
Notifications
You must be signed in to change notification settings - Fork 117
bugfix: Prevent manually ejecting rappelling units during combat drops #1789
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?
bugfix: Prevent manually ejecting rappelling units during combat drops #1789
Conversation
| Object* rappeller = getPotentialRappeller(obj); | ||
| if (rappeller != NULL) | ||
| { | ||
| rappeller->setStatus(MAKE_OBJECT_STATUS_MASK(OBJECT_STATUS_IS_USING_ABILITY)); |
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.
Should this be added AFTER confirming door is available?
If I understand correctly, when a door is not available, the status will never get cleared (the loop only clears units in the tracking list), so the unit could get stuck with the flag.
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.
The door cannot be reserved unless getAiFreeToExit returns true. If you follow the chain, you'll find reserveDoorForExit → isSpecificRiderFreeToExit → getAiFreeToExit. It really only needs the status to be set directly before and to be cleared directly after, but I felt it was not as intuitive. Perhaps it is better to do it this way to reduce complexity and the likelihood of unforeseen consequences.
rappeller->setStatus(OBJECT_STATUS_IS_USING_ABILITY);
exitInterface->reserveDoorForExit();
rappeller->clearStatus(OBJECT_STATUS_IS_USING_ABILITY);It's unexpected that a door is unavailable when rappelling as indicated by DEBUG_CRASH(("rappeller is not free to exit... what?"));.
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.
Ah, I see what you mean, so the status has to be set before the door reservation, makes sense. This works, although I really enjoy watching the bugged version 😆 . LGTM
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.
This causes a mismatch with retail with the RETAIL_COMPATIBLE_CRC set at (1)
Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp
Outdated
Show resolved
Hide resolved
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.
Well done. I tested it and it no longer mismatches.
Summarizing:
- Tested and works as described.
- Tested that the
RETAIL_COMPATIBLE_CRCguard is used correctly. Normal build does not mismatch against retail. - The code looks good.
This change prevents rappelling units from being manually ejected during combat drops.
Before
Clicking a passenger's icon in the command bar during a combat drop will eject that unit in the air
DANGEROUS_RAPPEL.mp4
After
Clicking a passenger's icon in the command bar during a combat drop will do nothing
SAFE_RAPPEL.mp4