-
Notifications
You must be signed in to change notification settings - Fork 126
bugfix: Prevent ranking of riders that are not trainable #1970
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?
Conversation
| return FALSE; | ||
|
|
||
| #if !RETAIL_COMPATIBLE_CRC | ||
| const ContainModuleInterface* contain = other->getContain(); |
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.
// TheSuperHackers @bugfix ...
| return FALSE; | ||
|
|
||
| // Sorry, you can't gain levels | ||
| if( !other->getExperienceTracker()->isTrainable() ) |
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.
Seeing these conditions now used at 2 places, how about add a function in Object for "eligibleForLevelUp" and then call that here and in CommandXlat? This way the conditions stay in sync.
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 did consider this, but as one of the usages is debug logic, I thought it would not really be that useful.
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 probably would add a Object::isTrainable, since it has this intricacy with the Rider.
30f557c to
fce6f1d
Compare
This change fixes an issue that allows riders to rank up even if they are not trainable. For example, a player might place a Worker on a Combat Cycle and then drive over a Salvage Crate.
Before
A mounted Worker ranks up when driving over a Salvage Crate
RANKED_WORKER.mp4
After
Only trainable mounted units can rank up
TRAINABLE_VET.mp4
Note: The changes to Generals are solely for unification. Riders do not exist there.