-
Notifications
You must be signed in to change notification settings - Fork 81
[GEN][ZH] Fix undefined behavior in ThingTemplate::isEquivalentTo #932
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
[GEN][ZH] Fix undefined behavior in ThingTemplate::isEquivalentTo #932
Conversation
GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ProductionUpdate.cpp
Outdated
Show resolved
Hide resolved
The better solution here might be to get rid of the equivalent to function and Instead implement an overload for the comparison operator within thingtemplate. Then do |
I like that approach. |
The change also needs to be replicated in Generals |
9dad48b
to
d914978
Compare
d914978
to
5c33dbb
Compare
This reverts commit 5c467bc.
Updated and replicated in Generals. I made the assumption that the |
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.
Looks very safe.
Another case of checking 'this' pointer in a member function like #870 & #878
GeneralsGameCode/GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp
Lines 1479 to 1484 in 15a53d5
This pr fixes the undefined behavior in
ThingTemplate::isEquivalentTo
by making it a static function.If the changes are considered acceptable, then it needs to be replicated in Generals. As far as I'm concerned that can be done in this pr as well.