Skip to content

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.

fix(gameclient): ctrl+shift drag draws the attack line, not a circle

Olcay Seygan1c54d467281c
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 10b9b0873..5e65c60fd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -53,7 +53,7 @@ found and fixed — EA's own, not port damage.**
- The choice between a Classic and a Reforged interface is gone. There is one, laid out the way Zero Hour shipped, and the orders Reforged added now live on the keys you already know: A attack-moves, holding Ctrl fires on whatever is under the cursor as it did in 2003 (that hold is yours to move on the launcher's Command bar page), a guard order can cover a patch of ground instead of one spot, and orders queue up one after another. Everything your base is building stands on the screen as a line of text each, the six closest to done first and "+N more" for the rest. Superweapon countdowns are listed the same way, up to eighteen. Both lists are in bold type, the build list in white and each countdown in its owner's colour. The promotion screen no longer darkens the battlefield behind it. Whether the right button gives orders, or the left as in 1.04, is a setting in the launcher.
- An attack move and a Ctrl attack fire on the left click in every mouse setup. With the right button giving orders, A then a right click attack-moved, and Ctrl fired only on a right click, so the same hands did different things depending on one checkbox. Now A, or Ctrl held, then a left click is the attack everywhere, and a right click with A armed puts the key down without an order. Ctrl with a right click gives none. Plain orders stay on whichever button your setup gives them.
-- Combat units that attack-move now have a Force Attack button on the command bar, under Attack Move and left of Stop. Base defences that shoot have it too: the Patriot Battery of every general, the Gattling Cannon, the Fire Base, the Stinger Site and the Bunker, wherever their bar has a free place, so a defence can fire on the ground or on a friendly. So does the Air Force General's Combat Chinook. In the Bunker and the Chinook it is the soldiers inside who fire, and Ctrl on a garrisoned Bunker now takes a unit as its target as well as the ground; before, only the ground. A Tunnel Network's bar is full, and so is the Infantry General's ten-man Bunker, so neither gets the button. It arms the same fire-on-whatever-is-under-the-pointer mode the hold key has always given. The hold is Ctrl until you change it on the launcher's Hotkeys page, Command bar tab, and the button wears whatever you bound. Shift on top of that hold keeps it: the pointer stays the force-fire one and a drag still draws the fire circle, its targets queued. This version's data checksum differs, so it cannot join a game hosted on an older one.
+- Combat units that attack-move now have a Force Attack button on the command bar, under Attack Move and left of Stop. Base defences that shoot have it too: the Patriot Battery of every general, the Gattling Cannon, the Fire Base, the Stinger Site and the Bunker, wherever their bar has a free place, so a defence can fire on the ground or on a friendly. So does the Air Force General's Combat Chinook. In the Bunker and the Chinook it is the soldiers inside who fire, and Ctrl on a garrisoned Bunker now takes a unit as its target as well as the ground; before, only the ground. A Tunnel Network's bar is full, and so is the Infantry General's ten-man Bunker, so neither gets the button. It arms the same fire-on-whatever-is-under-the-pointer mode the hold key has always given. The hold is Ctrl until you change it on the launcher's Hotkeys page, Command bar tab, and the button wears whatever you bound. Shift on top of that hold keeps it: the pointer stays the force-fire one, and a drag draws the attack line instead of the circle. This version's data checksum differs, so it cannot join a game hosted on an older one.
- The dark plate behind Exit, Restart and the options screen in a match covers the whole picture. It used to sit in a 4:3 frame in the middle, so a widescreen left the battlefield bright down both sides. The box itself keeps the shape it was drawn in.
- Buildings select together again, which the one interface had taken away. Shift-click them, drag a box over them, or double-click one for every building of its kind on the screen; select four War Factories and each tank you click goes to whichever has the shortest queue. Double-click a unit and every one of that kind whose feet sit in the picture is taken, including the ones sitting past the camera's far clip that used to be skipped. A building and a unit still never share a selection.
- Formation lines are back for everyone. With move, attack move or guard armed, a left drag spreads the selection along the line you draw again; since the one interface it drew a selection box instead, because the line was switched off for the Classic mouse that every player now runs. A drag with no order armed is still the selection box.
@@ -349,7 +349,7 @@ found and fixed — EA's own, not port damage.**
## Selecting and ordering with the mouse
- Ctrl+Q now takes infantry only, not every armed thing you own.
-- A box drawn with Ctrl held takes those units back out of your selection instead of replacing it, so a group is trimmed by dragging over the corner of it rather than picked again from scratch. Held with Alt the box keeps only what can shoot: drag across your base and you get the tanks, not the dozers and supply trucks standing among them. Both are drag-only, and a single click still means exactly what it always did. Hold Ctrl and Shift and drag and you draw the fire circle, the same as with Ctrl alone, and its targets go on the end of what the group is already working through. Pressing Shift used to let go of the Ctrl hold, so the pointer turned back into the ordinary one and the drag grew a selection box instead.
+- A box drawn with Ctrl held takes those units back out of your selection instead of replacing it, so a group is trimmed by dragging over the corner of it rather than picked again from scratch. Held with Alt the box keeps only what can shoot: drag across your base and you get the tanks, not the dozers and supply trucks standing among them. Both are drag-only, and a single click still means exactly what it always did. Hold Ctrl and Shift and drag and you draw a freehand attack line, drawn like an attack-move line, and on release the enemies near it are shared out as targets. Ctrl alone still draws the fire circle. Pressing Shift used to let go of the Ctrl hold, so the pointer turned back into the ordinary one and the drag grew a selection box instead.
- A box dragged over your army and your economy together takes the army. The dozers, workers, supply trucks and hackers standing among the tanks stay where they are, and ambulances and troop carriers go with the soldiers they look after. A box with nobody military in it takes the workers the way it always did.
- The three buttons are split cleanly now. Left selects, and only selects. A right click gives the order, and a right drag scrolls the map the way it did in 2003: the spot you pressed on stays put, and the further you pull away from it the faster the map runs. The drag only starts once the pointer has really travelled, so a click your hand wobbles a pixel or two is still an order and the camera does not twitch. A pan never throws away the building on your cursor or the power you were about to aim. The middle button turns the view, with no key held, and a middle click without a drag puts the camera back where it started. The wheel zooms toward whatever the cursor is over and the screen edges still scroll. The classic scheme, where left both selected and commanded and right scrolled and deselected, is gone rather than switched off, and the two checkboxes that used to choose between them are out of the options screen.
- How far the pointer travels before a click becomes a drag is yours to set. Drag Threshold on Options > Controls runs from 2 to 50 pixels, and the game's own value was 25. Raise it if selection boxes start by accident, lower it if your drags are read as clicks.
@@ -359,7 +359,7 @@ found and fixed — EA's own, not port damage.**
- A unit standing guard draws its marker on the ground it is guarding. A guard order clears the unit's goal on the way in, so every guard marker used to sit in the bottom left corner of the map with a thread running the whole way across it, whatever the unit was actually watching.
- A is attack and D is attack move, each arming the next order click. A click on the ground with A held down is a shot at that ground, on your own tank a shot at your own tank, and the mode drops again the moment the order goes out, so nothing stays armed behind your back. The click keeps your group, too: an attack click that was not a drag used to run the same deselect an ordinary left click runs, so the order arrived a moment after the units it was meant for had been dropped. Both orders are aimed with the left button, the way a special power is, and a right click puts the key down again without giving any order. Holding ctrl no longer forces fire: A is the one way to shoot the ground, and ctrl on a move is only the shared pace. The two keys turn each other off, and the letters they took were sitting on grid commands that moved. With A armed, pointing at something nothing in your selection can shoot shows the game's can't-do-that pointer: a Sentry Drone before its gun is researched has no weapon at all, and the pointer used to look ready while the click did nothing.
- G is guard, armed the same way and aimed with the same left button. A left click posts the selection on that spot: they hold it, shoot what walks into range and do not chase it off the post you put them on. G looks the way Zero Hour's own guard button always looked: the targeting cross, with the guard range laid on the ground under it, and the mouse wheel still zooms the camera. The guard button on the command bar arms the same key, so it clicks and drags the same way. Drag the left button with G armed and they post along the line you draw, one unit per station, the way an attack move line spreads them, which is how a hill or a bridge approach gets covered in one gesture instead of a click per tank. A right click puts the key down again. Hold position, which posts every unit on the spot it is already standing on, has moved to H.
-- With A armed, or with Ctrl held down, hold the left button and drag a circle instead: the enemies you can see inside it are split across the units that can shoot, as evenly as the numbers allow, in the order both sides stand around the circle. The tank on the left of your group takes the enemy on the left of theirs. Ten of yours against three of theirs put four guns on one and three on each of the others. Three of yours against ten of theirs each take a run of three or four and work down that run. One enemy, and every selected gun takes it. When a unit's target dies the next of its own goes out the same frame, so a strike group clears a circle without you clicking once per tank. It moves on from a target the group has stopped working on, too, rather than only from a dead one: something none of them can reach or hurt used to sit at the head of the list and hold every other target behind it for the rest of the match. That list is the same queue a shift-clicked attack builds, so you can see it: every target still owed has its own thread and marker, in the order they will be taken, instead of one line to whatever is being shot at this second. Hold shift while you draw the circle and its targets go on the end of what the group is already working through; draw it without shift and the circle replaces the lot. The circle's rim is red and the ground inside it is washed the same red while you drag it, painted on the map rather than over it, so it runs up the hills inside the circle and your own tanks stand on top of it. The rim sits in the plane of the press, so a hill or a building under the cursor no longer jumps the circle every frame. Any order you give by hand ends the list. Losing a unit does not: the list belongs to the group that was told and carries on with whoever is left, which is worth saying because for a while it did not, and one tank dying threw away every target still owed. Running out of ammo does not cost you the list either. A flight that empties its racks flies home, lands, rearms and comes back to the target it left, and the queue waits for it instead of counting the trip as the group giving up: a circle drawn for four planes used to be empty by the time they were back in the air, one entry lost every two seconds they were away. The threads stay on the ground for the whole trip, too. A plane flying home has no target and no order to read, so the list it was still holding used to vanish off the map the moment it turned for base and reappear only when it was shooting again, which looks exactly like the list being thrown away. What the circle picks up is what you can shoot: a shell or a missile crossing it is on the enemy's side like everything else and used to go on the list as a target, costing the group a two second stall on something that was about to stop existing. A target that has driven into the shroud since you picked it keeps its place in the list but stops drawing its thread, so the line cannot be used to trace it through the fog. An attack-move queued behind other orders keeps the force fire it was given rather than losing it when the attack key drops. A stroke drawn across enemies splits them across the units that can shoot, as evenly as the numbers allow, in the order both sides stand along the stroke. The unit nearest the start takes the enemy nearest the start. Ten guns on three enemies put four on one and three on each of the others. Three guns on ten each work down a run of three or four. The whole group used to walk one list and pour every gun into each enemy in turn. Before that the line poured fire into the ground under it and hit whatever happened to be standing there. A stroke that crosses nobody still fires on the ground along it.
+- With A armed, or with Ctrl held down, hold the left button and drag a circle instead: the enemies you can see inside it are split across the units that can shoot, as evenly as the numbers allow, in the order both sides stand around the circle. The tank on the left of your group takes the enemy on the left of theirs. Ten of yours against three of theirs put four guns on one and three on each of the others. Three of yours against ten of theirs each take a run of three or four and work down that run. One enemy, and every selected gun takes it. When a unit's target dies the next of its own goes out the same frame, so a strike group clears a circle without you clicking once per tank. It moves on from a target the group has stopped working on, too, rather than only from a dead one: something none of them can reach or hurt used to sit at the head of the list and hold every other target behind it for the rest of the match. That list is the same queue a shift-clicked attack builds, so you can see it: every target still owed has its own thread and marker, in the order they will be taken, instead of one line to whatever is being shot at this second. Hold Alt while you draw the circle and its targets go on the end of what the group is already working through; draw it without Alt and the circle replaces the lot. The circle's rim is red and the ground inside it is washed the same red while you drag it, painted on the map rather than over it, so it runs up the hills inside the circle and your own tanks stand on top of it. The rim sits in the plane of the press, so a hill or a building under the cursor no longer jumps the circle every frame. Any order you give by hand ends the list. Losing a unit does not: the list belongs to the group that was told and carries on with whoever is left, which is worth saying because for a while it did not, and one tank dying threw away every target still owed. Running out of ammo does not cost you the list either. A flight that empties its racks flies home, lands, rearms and comes back to the target it left, and the queue waits for it instead of counting the trip as the group giving up: a circle drawn for four planes used to be empty by the time they were back in the air, one entry lost every two seconds they were away. The threads stay on the ground for the whole trip, too. A plane flying home has no target and no order to read, so the list it was still holding used to vanish off the map the moment it turned for base and reappear only when it was shooting again, which looks exactly like the list being thrown away. What the circle picks up is what you can shoot: a shell or a missile crossing it is on the enemy's side like everything else and used to go on the list as a target, costing the group a two second stall on something that was about to stop existing. A target that has driven into the shroud since you picked it keeps its place in the list but stops drawing its thread, so the line cannot be used to trace it through the fog. An attack-move queued behind other orders keeps the force fire it was given rather than losing it when the attack key drops. A stroke drawn across or near enemies (Ctrl and Shift held, then drag) splits them across the units that can shoot, as evenly as the numbers allow, in the order both sides stand along the stroke. The unit nearest the start takes the enemy nearest the start. Ten guns on three enemies put four on one and three on each of the others. Three guns on ten each work down a run of three or four. The whole group used to walk one list and pour every gun into each enemy in turn. Before that the line poured fire into the ground under it and hit whatever happened to be standing there. A stroke that crosses nobody still fires on the ground along it.
- Shift queues a guard as well, and it is where the line of orders stops. Hold shift with G armed and click, and the group takes up its post once it has finished everything queued in front of it: clear that ridge, then sit on it, in one set of clicks instead of standing over the fight waiting to give the last order. Nothing goes behind a guard, because a posted unit has no next place to be. The thread to the post is drawn in the guard colour like any other guard.
- 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.
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/CommandXlat.h b/GeneralsMD/Code/GameEngine/Include/GameClient/CommandXlat.h
index f886916af..404356733 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/CommandXlat.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/CommandXlat.h
@@ -69,6 +69,7 @@ private:
// the player is already dragging. With attack move or guard armed only the left button draws
// one, otherwise only the right, and the anchor is wherever the drawing button went down.
Bool m_formationDragArmed;
+ Bool m_formationDragForceLine; ///< latched with it: the line was begun under the Force Attack hold and shift
ICoord2D m_formationDragAnchor;
void finishFormationDrag( const ICoord2D& lift );
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
index eddaf123f..2d6f4ebcd 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
@@ -1141,6 +1141,7 @@ public: // ********************************************************************
void toggleMoveArmed( void ) { m_moveArmed = !m_moveArmed; m_attackMoveToMode = FALSE; m_forceAttackArmed = FALSE; m_guardArmed = FALSE; }
Bool isMoveArmed( void ) const { return m_moveArmed; }
Bool isLineOrderArmed( void ) const { return m_attackMoveToMode || m_guardArmed || m_moveArmed; } ///< a left drag draws a move, attack move or guard line; force fire's left drag is the attack circle
+ Bool isForceLineHeld( void ) const; ///< the Force Attack hold with shift: a left drag draws the attack line, not the circle
// zeroing the repeat clock makes the first quantized step happen on the very next update, so a
// tap of the key is one eighth and a hold is one eighth every CAMERA_SNAP_REPEAT_MS.
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
index 8863a9487..b92ba6e1d 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
@@ -3179,7 +3179,7 @@ void InGameUI::updateFormationHints( void )
if( obj->isKindOf( KINDOF_IMMOBILE ) || obj->getAIUpdateInterface() == NULL )
continue;
// the same riders the logic leaves out of a formation move (GameLogicDispatch)
- if( obj->isDisabledByType( DISABLED_HELD ) && !isForceAttackArmed() && !isGuardArmed() )
+ if( obj->isDisabledByType( DISABLED_HELD ) && !isForceAttackArmed() && !isForceLineHeld() && !isGuardArmed() )
continue;
movers.push_back( obj );
}
@@ -3194,7 +3194,7 @@ void InGameUI::updateFormationHints( void )
{
OrderHint hint;
hint.kind = isInAttackMoveToMode() ? ORDER_HINT_ATTACK_MOVE
- : isForceAttackArmed() ? ORDER_HINT_ATTACK
+ : ( isForceAttackArmed() || isForceLineHeld() ) ? ORDER_HINT_ATTACK
: isGuardArmed() ? ORDER_HINT_GUARD
: ORDER_HINT_MOVE;
hint.owner = movers[ i ]->getID();
@@ -4086,8 +4086,8 @@ Bool InGameUI::issueAttackCircle( void )
previousAttacker = attacker.id;
// each unit's first shot starts that unit's list. the rest of its run is queued behind it.
- // shift, or the waypoint key, appends the whole run onto whatever that one unit was already doing.
- const Bool startsList = firstForThisAttacker && !isInWaypointMode() && !TheKeyboard->isShift();
+ // shift appends the whole run onto whatever that one unit was already doing.
+ const Bool startsList = firstForThisAttacker && !isInWaypointMode();
markNextOrderQueued( startsList ? ORDER_QUEUE_FRESH : ORDER_QUEUE_APPEND );
GameMessage *attack = TheMessageStream->appendMessage( GameMessage::MSG_DO_ATTACK_OBJECT );
attack->appendObjectIDArgument( target.id );
@@ -4134,15 +4134,16 @@ Bool InGameUI::isAttackListTarget( const Object *obj, const Player *local ) cons
/** The line drawn with the attack key: every enemy it runs across is shared across the units that
* can shoot, in the order both sides stand along the stroke, nearest the start first. The shots
* are dealt the same way as the circle, so the counts differ by one at most, and each unit works
- * down its own share. "Across" is the line passing over the object's own footprint, give or take
- * a few feet for a hand that is not steady. Returns how many enemies the line crossed. With
+ * down its own share. "Across" is the line passing over the object's own footprint or near it,
+ * within LINE_TOLERANCE of its edge. Returns how many enemies the line crossed. With
* none, the caller fires on the ground along the line instead. Enemies that nobody selected can
* shoot still count, so the ground is not fired in their place. */
//-------------------------------------------------------------------------------------------------
Int InGameUI::issueAttackLine( const std::vector<Coord3D>& line )
{
- // how far off the line a unit's edge may be and still count as under it
- const Real LINE_TOLERANCE = 10.0f;
+ // how far off the line a unit's edge may be and still count: the line is drawn near the enemies
+ // it means, not threaded through each one, so a tank's length either side of it counts
+ const Real LINE_TOLERANCE = 40.0f;
// the range query measures to centres, so it reaches this much further for a building whose
// centre is off the line and whose walls are under it
@@ -4280,8 +4281,8 @@ Int InGameUI::issueAttackLine( const std::vector<Coord3D>& line )
previousAttacker = attacker.id;
// each unit's first shot starts that unit's list. the rest of its run is queued behind it.
- // shift, or the waypoint key, appends the whole run onto whatever that one unit was already doing.
- const Bool startsList = firstForThisAttacker && !isInWaypointMode() && !TheKeyboard->isShift();
+ // shift appends the whole run onto whatever that one unit was already doing.
+ const Bool startsList = firstForThisAttacker && !isInWaypointMode();
markNextOrderQueued( startsList ? ORDER_QUEUE_FRESH : ORDER_QUEUE_APPEND );
GameMessage *attack = TheMessageStream->appendMessage( GameMessage::MSG_DO_ATTACK_OBJECT );
attack->appendObjectIDArgument( target.id );
@@ -4966,6 +4967,15 @@ Bool InGameUI::isForceFireOn( void ) const
return m_forceAttackArmed || m_forceAttackMode;
}
+//-------------------------------------------------------------------------------------------------
+/** Shift on top of the Force Attack hold turns its left drag from the circle into the attack line.
+ * An armed move, attack move or guard key keeps its own line. */
+//-------------------------------------------------------------------------------------------------
+Bool InGameUI::isForceLineHeld( void ) const
+{
+ return m_forceAttackMode && !isLineOrderArmed() && TheKeyboard->isShift();
+}
+
//-------------------------------------------------------------------------------------------------
/// Get drawable ID under cursor
//-------------------------------------------------------------------------------------------------
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp
index 1f2a03e5d..5936e2bf8 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp
@@ -1455,7 +1455,8 @@ CommandTranslator::CommandTranslator() :
m_teamExists(false),
m_mouseRightDown(0),
m_mouseRightUp(0),
- m_formationDragArmed(FALSE)
+ m_formationDragArmed(FALSE),
+ m_formationDragForceLine(FALSE)
{
m_mouseRightDragAnchor.x = 0;
m_mouseRightDragAnchor.y = 0;
@@ -1499,7 +1500,7 @@ void CommandTranslator::finishFormationDrag( const ICoord2D& lift )
// walks it and shoots what it meets; the attack key fires on the line where it stands
const GameMessage::Type formationType =
Command_formationMessage( TheInGameUI->isInAttackMoveToMode(),
- TheInGameUI->isForceAttackArmed(),
+ TheInGameUI->isForceAttackArmed() || m_formationDragForceLine,
TheInGameUI->isGuardArmed() );
// the traced curve becomes world points; who stands where along it is decided on
@@ -4101,15 +4102,18 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage
//-----------------------------------------------------------------------------
// A formation line is drawn with the left button, and only once the move, attack move or guard
- // key is armed: a left drag without one is a selection box. The attack key keeps its left
- // drag for the attack circle.
+ // key is armed: a left drag without one is a selection box. The attack key and the Force
+ // Attack hold keep their left drag for the attack circle; shift on the hold draws the attack
+ // line here instead, aimed at the enemies near it.
case GameMessage::MSG_RAW_MOUSE_LEFT_DOUBLE_CLICK:
case GameMessage::MSG_RAW_MOUSE_LEFT_BUTTON_DOWN:
{
- if( TheInGameUI->isLineOrderArmed() )
+ const Bool forceLine = TheInGameUI->isForceLineHeld();
+ if( TheInGameUI->isLineOrderArmed() || forceLine )
{
m_formationDragAnchor = msg->getArgument( 0 )->pixel;
m_formationDragArmed = isFormationDragArmed();
+ m_formationDragForceLine = forceLine;
}
break;
}
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp
index 9ef24dfc9..cb2f61589 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp
@@ -456,7 +456,8 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa
// with attack move or guard armed a left drag draws the order line over in CommandXlat, so
// no selection box grows under it, whichever mouse is set. A drag with no key armed is the box
- const Bool leftDragIsOrder = TheInGameUI->isLineOrderArmed()
+ const Bool leftDragIsOrder = ( TheInGameUI->isLineOrderArmed() || TheInGameUI->isForceLineHeld()
+ || TheInGameUI->isFormationDragging() )
&& TheInGameUI->getSelectCount() > 0;
if (m_leftMouseButtonIsDown && !leftDragIsOrder)
{
@@ -1104,9 +1105,10 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa
// with the attack key armed or the Force Attack hold down the left button draws a circle
// instead of a selection box, and everything hostile inside it becomes a target list. An
- // armed line key (move, attack move, guard) keeps its line under the hold. Shift on top
- // of the hold or the attack key still draws the circle and queues its targets.
- if( TheInGameUI->isForceFireOn() && !TheInGameUI->isLineOrderArmed() && TheInGameUI->getSelectCount() > 0
+ // armed line key (move, attack move, guard) keeps its line under the hold, and shift on top
+ // of the hold draws the attack line over in CommandXlat instead.
+ if( TheInGameUI->isForceFireOn() && !TheInGameUI->isLineOrderArmed() && !TheInGameUI->isForceLineHeld()
+ && TheInGameUI->getSelectCount() > 0
&& TheInGameUI->getGUICommand() == NULL && TheInGameUI->getPendingPlaceType() == NULL )
TheInGameUI->beginAttackCircle( m_selectFeedbackAnchor );
break;
@@ -1147,10 +1149,10 @@ GameMessageDisposition SelectionTranslator::translateGameMessage(const GameMessa
break;
}
- // a left drag that drew an attack move or guard line is turned into its order by CommandXlat,
- // which sees this release next. The click behind the release would select whatever sat
- // under it and drop the group the line was drawn for
- if( TheInGameUI->isFormationDragging() && TheInGameUI->isLineOrderArmed() )
+ // a left drag that drew an attack move, guard or attack line is turned into its order by
+ // CommandXlat, which sees this release next. The click behind the release would select
+ // whatever sat under it and drop the group the line was drawn for
+ if( TheInGameUI->isFormationDragging() )
{
m_dragOrderJustIssued = TRUE;
break;