[GEN][ZH] Fix undefined behavior in ThingTemplate::isEquivalentTo#932
Conversation
GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AISkirmishPlayer.cpp
Outdated
Show resolved
Hide resolved
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 |
GeneralsMD/Code/GameEngine/Source/Common/Thing/ThingTemplate.cpp
Outdated
Show resolved
Hide resolved
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 |
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::isEquivalentToby 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.