Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.
C++ cmakecnccommand-and-conquercppdirectx11game-enginegame-preservationgeneralsrtssage-enginex64zero-hour
fix(gameengine): attack-move through waypoints and the minimap, clear a rally point
Olcay Seygan548d9d2fbf73
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 5f13eabdb..f726f50da 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -192,6 +192,7 @@ found and fixed — EA's own, not port damage.**- Shift queues an attack now, not only a move. A or F held down while you shift-click adds a force-attack or an attack-move to the line of orders a group is already holding, and it fires the moment the order in front of it is finished - a target dead, or nobody left chasing an attack-move point. The coloured thread that shows a queued order covers it too, so a queue of "go here, then attack that, then attack-move over there" reads as one continuous line in three colours. The game's own white waypoint markings, which used to draw over the same ground the moment shift went down, are gone - they only ever duplicated what the coloured thread already showed, and doing both left a queued attack sitting under two different pictures of itself.- The shift queue takes any mix of orders now and stays with the units you gave it to. Move, attack-move, attack a target, draw a formation line, then guard: hold shift, click them in whatever order you like, and the group works down the list by itself. Queue an army's whole route, select something else, go back to your base, and the army keeps going. Before, clicking anything else threw the list away. Each step also starts the moment the one before it is done. It used to wait for the order to travel to the other players and back, which on a 250ms connection was a quarter of a second standing still at every corner. The group keeps together: nobody starts the next order until everyone still alive has finished this one, so a column does not string out behind its fastest tank. Select part of a group and shift-click, and that part takes its own copy of the list with the new order on the end while the others carry on with theirs. Shift-click a group that is already on an ordinary move and the new point goes behind the move instead of replacing it.- Shift queues whatever a right-click orders, not just moves. Shift-right-click an enemy tank and killing it goes on the list; do it on a building with a Black Lotus selected and taking the building goes on the list. A transport to climb into, a repair bay, a hospital and a supply dock work the same way, and so does an ability armed from the command bar. "Walk here, take that supply center, walk on" is one set of clicks, and the list waits for the capture to finish before anyone sets off for the next point. Upgrades queue as well: shift-click the Overlord's Gatling cannon and it is bought when the Overlord gets there and paid for then. If the money is not in the bank by that time the upgrade is passed over and the list carries on. Each unit with more than one place to go numbers its markers in the order it will reach them, and a step the colour cannot tell apart from a move carries its own cursor next to the number, or the upgrade's picture. A shift-click on one of your own units is still a point on the path. Keep shift down after pressing F, A or G and the key stays armed, so five targets are one key and five clicks instead of five of each; it drops when shift comes up. A guard, a hold or fire on the ground ends a list for good. Nothing queues behind one, whether it was given with shift or without, until an order without shift takes the units off it. Replays recorded before this version that shift-clicked an upgrade, or gave a unit holding a list an ability without shift, play back differently.+- Attack move stays armed for as long as shift is down, whether you pressed its key or clicked its button on the bar, so every point you queue is an attack move. Orders given on the minimap are the orders they would be on the battlefield: an armed attack move is an attack move there too, and shift adds to the queue. Passing the pointer over the minimap no longer puts an armed attack move down.- What the circle picks up is what you can see, and a stealthed unit is not that. Shroud was the only test, so a hidden tank parked in ground you had already cleared went on the list like anything else: drag a circle over open country and the group opened fire on air, one order per hidden unit, which is a stealth detector drawn with the mouse. An undetected unit is not in the circle.- Ctrl+D takes every unit of the kinds you have selected that is on the screen, and pressed twice inside half a second takes them across the whole map. One tank selected and two keystrokes is your whole armour, wherever it is standing. It was on Shift+Ctrl+E, which is three fingers for something you do in every fight, and it only ever reached across the map when the screen had nothing left to give - so the wide selection happened to you instead of being asked for.@@ -201,6 +202,7 @@ found and fixed — EA's own, not port damage.**- Losing the airfield no longer leaves its aircraft circling rubble forever.- Repaired aircraft fly to the rally point instead of hovering over the pad.- Infantry leaving a captured building follow its rally point too.+- Right-click a selected factory or barracks and its rally point is gone. Before, a rally point could be moved and that was all.- A Chinook unloads its passengers one at a time, not stacked in one frame.- Campaign reinforcements flown in by Chinook land again. That one-at-a-time unloading sent a mission's scripted Chinooks home with their cargo still aboard, so on the second American mission the dozers announced at the docks never got off, and neither did the next one.- A guarding unit no longer fights itself between returning to post and shooting back.diff --git a/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h b/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.hindex 8f40a7ed5..1b5121160 100644--- a/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h+++ b/GeneralsMD/Code/GameEngine/Include/Common/MessageStream.h@@ -651,6 +651,7 @@ public:MSG_PLACE_SIGNAL, ///< (location, Int SignalKind) smoke only the sender's allies are shown (fork)MSG_CHEAT, ///< (Int CheatKind, Int amount) a console cheat, refused in a network game (fork)MSG_QUEUE_NEXT_ORDER, ///< (Int OrderQueueMode) the order right after this one is a shift-queued one (fork)+ MSG_CLEAR_RALLY_POINT, ///< (objectID) the building forgets its rally point (fork)MSG_BEGIN_DEBUG_NETWORK_MESSAGES = 1900, ///< network messages that exist only in debug/internal builds. all grouped separately.diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/DefaultProductionExitUpdate.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/DefaultProductionExitUpdate.hindex ec8c61b09..7be97531c 100644--- a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/DefaultProductionExitUpdate.h+++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/DefaultProductionExitUpdate.h@@ -97,6 +97,7 @@ public:virtual void exitObjectByBudding( Object *newObj, Object *budHost ) { return; }virtual void setRallyPoint( const Coord3D *pos ); ///< define a "rally point" for units to move towards+ virtual void clearRallyPoint( void ) { m_rallyPointExists = false; }virtual const Coord3D *getRallyPoint( void ) const; ///< define a "rally point" for units to move towardsvirtual Bool useSpawnRallyPoint( void ) const;virtual Bool getNaturalRallyPoint( Coord3D& rallyPoint, Bool offset = TRUE ) const; ///< get the natural "rally point" for units to move towardsdiff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/OpenContain.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/OpenContain.hindex 7c741d622..99c40a638 100644--- a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/OpenContain.h+++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/OpenContain.h@@ -196,6 +196,7 @@ public:virtual void exitObjectByBudding( Object *newObj, Object *budHost ) { return; };virtual void setRallyPoint( const Coord3D *pos ); ///< define a "rally point" for units to move towards+ virtual void clearRallyPoint( void ) { m_rallyPointExists = false; }virtual const Coord3D *getRallyPoint( void ) const; ///< define a "rally point" for units to move towardsvirtual Bool getExitPosition(Coord3D& exitPosition ) const { return FALSE; }; ///< access to the "Door" position of the production objectvirtual Bool getNaturalRallyPoint( Coord3D& rallyPoint, Bool offset = TRUE ) const; ///< get the natural "rally point" for units to move towardsdiff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ParkingPlaceBehavior.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ParkingPlaceBehavior.hindex 48db84096..9552c55c4 100644--- a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ParkingPlaceBehavior.h+++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ParkingPlaceBehavior.h@@ -124,6 +124,7 @@ public:virtual Bool getExitPosition( Coord3D& rallyPoint ) const;virtual Bool getNaturalRallyPoint( Coord3D& rallyPoint, Bool offset = TRUE ) const;virtual void setRallyPoint( const Coord3D *pos ); ///< define a "rally point" for units to move towards+ virtual void clearRallyPoint( void ) { m_heliRallyPointExists = FALSE; }virtual const Coord3D *getRallyPoint( void ) const; ///< define a "rally point" for units to move towards// UpdateModulediff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/QueueProductionExitUpdate.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/QueueProductionExitUpdate.hindex bcdc80942..572835e31 100644--- a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/QueueProductionExitUpdate.h+++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/QueueProductionExitUpdate.h@@ -103,6 +103,7 @@ public:virtual void unreserveDoorForExit( ExitDoorType exitDoor );virtual void setRallyPoint( const Coord3D *pos ); ///< define a "rally point" for units to move towards+ virtual void clearRallyPoint( void ) { m_rallyPointExists = false; }virtual const Coord3D *getRallyPoint( void ) const; ///< define a "rally point" for units to move towardsvirtual Bool getExitPosition( Coord3D& exitPosition ) const; ///< access to the "Door" position of the production objectvirtual Bool getNaturalRallyPoint( Coord3D& rallyPoint, Bool offset = TRUE ) const; ///< get the natural "rally point" for units to move towardsdiff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SupplyCenterProductionExitUpdate.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SupplyCenterProductionExitUpdate.hindex b31270056..c3540d166 100644--- a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SupplyCenterProductionExitUpdate.h+++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/SupplyCenterProductionExitUpdate.h@@ -94,6 +94,7 @@ public:virtual void exitObjectByBudding( Object *newObj, Object *budHost ) { return; }virtual void setRallyPoint( const Coord3D *pos ); ///< define a "rally point" for units to move towards+ virtual void clearRallyPoint( void ) { m_rallyPointExists = false; }virtual const Coord3D *getRallyPoint( void ) const; ///< define a "rally point" for units to move towardsvirtual Bool getExitPosition( Coord3D& exitPosition ) const; ///< access to the "Door" position of the production objectvirtual Bool getNaturalRallyPoint( Coord3D& rallyPoint, Bool offset = TRUE ) const; ///< get the natural "rally point" for units to move towardsdiff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/UpdateModule.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/UpdateModule.hindex 9219b4b68..d2e4433d3 100644--- a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/UpdateModule.h+++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/UpdateModule.h@@ -368,6 +368,7 @@ public:virtual void exitObjectInAHurry( Object *newObj) {}; ///< Special call for objects exiting a tunnel network, does NOT change the ai state. jba.virtual void setRallyPoint( const Coord3D *pos ) = 0; ///< define a "rally point" for units to move towards+ virtual void clearRallyPoint( void ) {} ///< forget the rally point; an exit that never keeps one has nothing to forgetvirtual const Coord3D *getRallyPoint( void ) const = 0; ///< define a "rally point" for units to move towardsvirtual Bool useSpawnRallyPoint( void ) const { return FALSE; }virtual Bool getNaturalRallyPoint( Coord3D& rallyPoint, Bool offset = TRUE ) const {rallyPoint.x=rallyPoint.y=rallyPoint.z=0; return false;} ///< get the natural "rally point" for units to move towardsdiff --git a/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp b/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cppindex b5bc924b6..c396dc3eb 100644--- a/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp+++ b/GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp@@ -661,6 +661,7 @@ AsciiString GameMessage::getCommandTypeAsAsciiString(GameMessage::Type t)CHECK_IF(MSG_PLACE_SIGNAL)CHECK_IF(MSG_CHEAT)CHECK_IF(MSG_QUEUE_NEXT_ORDER)+ CHECK_IF(MSG_CLEAR_RALLY_POINT)CHECK_IF(MSG_DO_GUARD_OBJECT)CHECK_IF(MSG_DO_STOP)CHECK_IF(MSG_DO_SCATTER)diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cppindex 755021faa..6b2a67134 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp@@ -342,7 +342,15 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control,TheAudio->addAudioEvent( &sound );}- if( BitTest( commandButton->getOptions(), COMMAND_OPTION_NEED_TARGET ) )+ if( commandButton->getCommandType() == GUI_COMMAND_ATTACK_MOVE )+ {+ // The attack move button arms the same key its hotkey does, rather than becoming a pending+ // GUI command that one click uses up: shift then keeps it armed for a row of points. It+ // takes the place of whatever command was waiting for a target, as any other button would.+ TheInGameUI->setGUICommand( NULL );+ TheMessageStream->appendMessage( GameMessage::MSG_META_TOGGLE_ATTACKMOVE );+ }+ else if( BitTest( commandButton->getOptions(), COMMAND_OPTION_NEED_TARGET ) ){if (commandButton->getOptions() & USES_MINE_CLEARING_WEAPONSET){@@ -883,11 +891,6 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control,} // end cancel upgrade- //---------------------------------------------------------------------------------------------- case GUI_COMMAND_ATTACK_MOVE:- TheMessageStream->appendMessage(GameMessage::MSG_META_TOGGLE_ATTACKMOVE);- break;-//---------------------------------------------------------------------------------------------case GUI_COMMAND_STOP:{diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cppindex f54a40075..1d3f8c864 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp@@ -148,9 +148,9 @@ WindowMsgHandledType LeftHUDInput( GameWindow *window, UnsignedInt msg,const DrawableList *drawableList = TheInGameUI->getAllSelectedLocalDrawables();Mouse::MouseCursor cur = Mouse::ARROW;- if (!(drawableList->empty() || msg == GWM_MOUSE_LEAVING))+ if (!(drawableList->empty() || msg == GWM_MOUSE_LEAVING)){- if (command && command->getCommandType() == GUI_COMMAND_ATTACK_MOVE)+ if (TheInGameUI->isInAttackMoveToMode()){cur = Mouse::ATTACKMOVETO;}@@ -231,9 +231,9 @@ WindowMsgHandledType LeftHUDInput( GameWindow *window, UnsignedInt msg,const DrawableList *drawableList = TheInGameUI->getAllSelectedLocalDrawables();Mouse::MouseCursor cur = Mouse::ARROW;- if (!(drawableList->empty() || msg == GWM_MOUSE_LEAVING))+ if (!(drawableList->empty() || msg == GWM_MOUSE_LEAVING)){- if (command && command->getCommandType() == GUI_COMMAND_ATTACK_MOVE)+ if (TheInGameUI->isInAttackMoveToMode()){cur = Mouse::ATTACKMOVETO;}@@ -316,9 +316,8 @@ WindowMsgHandledType LeftHUDInput( GameWindow *window, UnsignedInt msg,break;}- // No drawables, or a right click automatically means its a look at.- // Having drawables and being in attack move mode means that we should attack move.- // Having drawables and not being in attack move mode means that we should move.+ // No drawables, or a left press, is a look at, and leaves an armed key armed the way a+ // pan of the main view does. A right press with drawables is an order.const DrawableList *drawableList = TheInGameUI->getAllSelectedLocalDrawables(); // locally-owned only@@ -331,50 +330,13 @@ WindowMsgHandledType LeftHUDInput( GameWindow *window, UnsignedInt msg,break;}- // evaluate any special powers that can be executed from the radar- const CommandButton *command = TheInGameUI->getGUICommand();- if( command- && (command->getCommandType() == GUI_COMMAND_SPECIAL_POWER || command->getCommandType() == GUI_COMMAND_SPECIAL_POWER_FROM_SHORTCUT)- && BitTest( command->getOptions(), NEED_TARGET_POS )- )- {+ // The order the same press on that spot of the ground gives: a special power, an attack+ // move or a guard off an armed key, a rally point, a move, each one queued under shift.+ TheGameClient->evaluateContextCommand( NULL, &world, CommandTranslator::DO_COMMAND );- // do the command- TheGameClient->evaluateContextCommand( NULL, &world, CommandTranslator::DO_COMMAND );-- } // end if- else if( command && command->getCommandType() == GUI_COMMAND_ATTACK_MOVE)- {- // Attack move has changed from a modifier to a command, so it moves up here.-- GameMessage *msg = TheMessageStream->appendMessage( GameMessage::MSG_DO_ATTACKMOVETO );- msg->appendLocationArgument( world );-- // Play the unit voice response- pickAndPlayUnitVoiceResponse(TheInGameUI->getAllSelectedDrawables(), GameMessage::MSG_DO_ATTACKMOVETO);- }- else- {- GameMessage *newMsg = NULL;-- // Do the superweapon stuff here, before issuing these other messages-- // GS Leaving commented out to show that isInAttackMoveToMode is NEVER SET. It's a command now, not a modifier.-// if (TheInGameUI->isInAttackMoveToMode())-// {-// newMsg = TheMessageStream->appendMessage(GameMessage::MSG_DO_ATTACKMOVETO);-// newMsg->appendLocationArgument(world);-// // Play the unit voice response-// pickAndPlayUnitVoiceResponse(drawableList, GameMessage::MSG_DO_ATTACKMOVETO);-// break;-// }-- newMsg = TheMessageStream->appendMessage(GameMessage::MSG_DO_MOVETO);- newMsg->appendLocationArgument(world);- // Play the unit voice response- pickAndPlayUnitVoiceResponse(drawableList, GameMessage::MSG_DO_MOVETO);-- } // end else+ // the order spends an armed key, unless shift is keeping it for the next point+ if( TheInGameUI->isOrderKeyArmed() )+ TheInGameUI->spendOrderKey();}@@ -389,7 +351,6 @@ WindowMsgHandledType LeftHUDInput( GameWindow *window, UnsignedInt msg,} // end switch( msg )- TheInGameUI->clearAttackMoveToMode();return MSG_HANDLED;} // end LeftHUDInputdiff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cppindex bba64e313..d6c666447 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp@@ -2368,6 +2368,23 @@ GameMessage::Type CommandTranslator::evaluateContextCommand( Drawable *draw,} // end else if#endif+ // ********************************************************************************************+ // A right click on a selected building takes the rally point away from everything selected.+ // Only the click is answered: the hover and SelectionXlat's EVALUATE_ONLY fall through as+ // they always did, so the building keeps its selection cursor.+ else if( type == DO_COMMAND && draw && draw->isSelected()+ && TheInGameUI->canSelectedObjectsDoAction( InGameUI::ACTIONTYPE_SET_RALLY_POINT, NULL, InGameUI::SELECTION_ALL, FALSE ) )+ {+ msgType = GameMessage::MSG_CLEAR_RALLY_POINT;++ // SELECTION_ALL above means every selected drawable has an object+ const DrawableList *allSelectedDrawables = TheInGameUI->getAllSelectedDrawables();+ for( DrawableList::const_iterator it = allSelectedDrawables->begin(); it != allSelectedDrawables->end(); ++it )+ {+ GameMessage *newMsg = TheMessageStream->appendMessage( msgType );+ newMsg->appendObjectIDArgument( (*it)->getObject()->getID() );+ }+ }// ********************************************************************************************else if ( pos && !draw && TheInGameUI->canSelectedObjectsDoAction( InGameUI::ACTIONTYPE_SET_RALLY_POINT, NULL, InGameUI::SELECTION_ALL, FALSE )){diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/GUICommandTranslator.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/GUICommandTranslator.cppindex 7e6804ea9..0de65a6fd 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/GUICommandTranslator.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/GUICommandTranslator.cpp@@ -259,43 +259,6 @@ static CommandStatus doGuardCommand( const CommandButton *command, GuardMode gua}-//--------------------------------------------------------------------------------------------------/** Do the set rally point command */-//--------------------------------------------------------------------------------------------------static CommandStatus doAttackMoveCommand( const CommandButton *command, const ICoord2D *mouse )-{-- // sanity- if( command == NULL || mouse == NULL )- return COMMAND_COMPLETE;-- //- // we can only set rally points for structures ... and we never multiple select structures- // so we must be sure there is only one thing selected (that thing we will set the point on)- //- Drawable *draw = TheInGameUI->getFirstSelectedDrawable();- DEBUG_ASSERTCRASH( draw, ("doAttackMoveCommand: No selected object(s)\n") );-- // sanity- if( draw == NULL || draw->getObject() == NULL )- return COMMAND_COMPLETE;-- // convert mouse point to world coords- Coord3D world;- TheTacticalView->screenToTerrain( mouse, &world );-- // send the message to set the rally point- GameMessage *msg = TheMessageStream->appendMessage( GameMessage::MSG_DO_ATTACKMOVETO );- msg->appendLocationArgument( world );-- // Play the unit voice response- pickAndPlayUnitVoiceResponse(TheInGameUI->getAllSelectedDrawables(), GameMessage::MSG_DO_ATTACKMOVETO);-- return COMMAND_COMPLETE;--}--//-------------------------------------------------------------------------------------------------/** Do the set rally point command *///-------------------------------------------------------------------------------------------------@@ -470,12 +433,6 @@ GameMessageDisposition GUICommandTranslator::translateGameMessage(const GameMess} // end special power- case GUI_COMMAND_ATTACK_MOVE:- {- commandStatus = doAttackMoveCommand( command, &mouse );- break;- }-//---------------------------------------------------------------------------------------case GUI_COMMAND_SET_RALLY_POINT:{diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cppindex ab5609483..418b97abc 100644--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp@@ -259,6 +259,26 @@ static void doSetRallyPoint( Object *obj, const Coord3D& pos )}+// ------------------------------------------------------------------------------------------------+/** The building goes back to what it was before its first rally point: whatever it makes stops+ * at the natural rally point by the door. */+// ------------------------------------------------------------------------------------------------+static void doClearRallyPoint( Object *obj )+{+ // the id came off the message, so it may name something that produces nothing+ ExitInterface *exitInterface = obj->getObjectExitInterface();+ if( exitInterface )+ exitInterface->clearRallyPoint();++ DEBUG_LOG(( "RALLY CLEAR: frame %d object %d\n", TheGameLogic->getFrame(), (Int)obj->getID() ));++ // mark the UI as dirty so that we re-evaluate the selection and take the flag down+ Drawable *draw = obj->getDrawable();+ if( obj->isLocallyControlled() && draw && draw->isSelected() )+ TheControlBar->markUIDirty();++}+static Object * getSingleObjectFromSelection(const AIGroup *currentlySelectedGroup){// an empty group is not the same as no group: the iterator below was taken from an empty@@ -674,6 +694,20 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, AIGroup *orderedGroup}+ //---------------------------------------------------------------------------------------------+ case GameMessage::MSG_CLEAR_RALLY_POINT:+ {+ // the same owner check MSG_SET_RALLY_POINT makes, for the same reason+ Object *obj = TheGameLogic->findObjectByID( msg->getArgument( 0 )->objectID );+ if (obj && obj->getControllingPlayer() == thisPlayer)+ {+ doClearRallyPoint( obj );+ }++ break;++ }+//---------------------------------------------------------------------------------------------case GameMessage::MSG_DO_WEAPON:{