File tree Expand file tree Collapse file tree 4 files changed +38
-0
lines changed
GeneralsMD/Code/GameEngine Expand file tree Collapse file tree 4 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -539,15 +539,27 @@ class AICommandInterface
539539 inline void aiFollowExitProductionPath ( std::vector<Coord3D>* path, Object *ignoreObject, CommandSourceType cmdSource )
540540 {
541541 AICommandParms parms (AICMD_FOLLOW_EXITPRODUCTION_PATH, cmdSource);
542+ #if __cplusplus >= 201103L
543+ parms.m_coords = std::move (*path);
544+ #else
545+ // TheSuperHackers @performance bobtista 23/11/2025 Use swap to emulate move semantics for VC6 compatibility
542546 parms.m_coords .swap (*path);
547+ path->clear ();
548+ #endif
543549 parms.m_obj = ignoreObject;
544550 aiDoCommand (&parms);
545551 }
546552
547553 inline void aiFollowPath ( std::vector<Coord3D>* path, Object *ignoreObject, CommandSourceType cmdSource )
548554 {
549555 AICommandParms parms (AICMD_FOLLOW_PATH, cmdSource);
556+ #if __cplusplus >= 201103L
557+ parms.m_coords = std::move (*path);
558+ #else
559+ // TheSuperHackers @performance bobtista 23/11/2025 Use swap to emulate move semantics for VC6 compatibility
550560 parms.m_coords .swap (*path);
561+ path->clear ();
562+ #endif
551563 parms.m_obj = ignoreObject;
552564 aiDoCommand (&parms);
553565 }
Original file line number Diff line number Diff line change @@ -818,7 +818,14 @@ void AIStateMachine::loadPostProcess( void )
818818 */
819819void AIStateMachine::setGoalPath ( std::vector<Coord3D>* path )
820820{
821+ #if __cplusplus >= 201103L
822+ m_goalPath = std::move (*path);
823+ #else
824+ // TheSuperHackers @performance bobtista 23/11/2025 Use swap to emulate move semantics for VC6 compatibility
825+ // Swap transfers ownership without copying. Clear source to make intent explicit.
821826 m_goalPath.swap (*path);
827+ path->clear ();
828+ #endif
822829}
823830
824831#ifdef STATE_MACHINE_DEBUG
Original file line number Diff line number Diff line change @@ -553,15 +553,27 @@ class AICommandInterface
553553 inline void aiFollowExitProductionPath ( std::vector<Coord3D>* path, Object *ignoreObject, CommandSourceType cmdSource )
554554 {
555555 AICommandParms parms (AICMD_FOLLOW_EXITPRODUCTION_PATH, cmdSource);
556+ #if __cplusplus >= 201103L
557+ parms.m_coords = std::move (*path);
558+ #else
559+ // TheSuperHackers @performance bobtista 23/11/2025 Use swap to emulate move semantics for VC6 compatibility
556560 parms.m_coords .swap (*path);
561+ path->clear ();
562+ #endif
557563 parms.m_obj = ignoreObject;
558564 aiDoCommand (&parms);
559565 }
560566
561567 inline void aiFollowPath ( std::vector<Coord3D>* path, Object *ignoreObject, CommandSourceType cmdSource )
562568 {
563569 AICommandParms parms (AICMD_FOLLOW_PATH, cmdSource);
570+ #if __cplusplus >= 201103L
571+ parms.m_coords = std::move (*path);
572+ #else
573+ // TheSuperHackers @performance bobtista 23/11/2025 Use swap to emulate move semantics for VC6 compatibility
564574 parms.m_coords .swap (*path);
575+ path->clear ();
576+ #endif
565577 parms.m_obj = ignoreObject;
566578 aiDoCommand (&parms);
567579 }
Original file line number Diff line number Diff line change @@ -823,7 +823,14 @@ void AIStateMachine::loadPostProcess( void )
823823 */
824824void AIStateMachine::setGoalPath ( std::vector<Coord3D>* path )
825825{
826+ #if __cplusplus >= 201103L
827+ m_goalPath = std::move (*path);
828+ #else
829+ // TheSuperHackers @performance bobtista 23/11/2025 Use swap to emulate move semantics for VC6 compatibility
830+ // Swap transfers ownership without copying. Clear source to make intent explicit.
826831 m_goalPath.swap (*path);
832+ path->clear ();
833+ #endif
827834}
828835
829836#ifdef STATE_MACHINE_DEBUG
You can’t perform that action at this time.
0 commit comments