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
feat(gameengine): remove the search and destroy order key
Olcay Seyganbaa57044baf6
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 71a21c851..8ca9c4055 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -304,7 +304,6 @@ found and fixed — EA's own, not port damage.**- A guarding unit no longer fights itself between returning to post and shooting back.- Guard covers the circle you choose. How far a guard reached used to come from each unit's own eyesight, so Rangers and Missile Defenders posted on the same spot held circles of 180 and 270 and a raider standing between the two was only shot by half the group. Now one guard order gives the whole group one circle, the widest any of them had. Roll the mouse wheel while the guard key or the guard button is armed and the circle grows or shrinks before you click, drawn on the ground under the pointer as you go. Select a guarding group and its circle is drawn round the post, and every unit of yours on guard carries a small steel shield over its head, selected or not, in place of the blocky "G" it used to wear.- Jets on guard attack what is inside the circle you drew. A plane on guard flies to its post and circles it, and since guards stopped shooting at enemies hidden in fog it only went after what that loop brought into its own sight: a Raptor guarding a circle of 700 hung over the post for the whole 80 seconds of the test with a power plant 550 out, and an Aurora circled for ten seconds before it found the same one. Aircraft are back on the original rule and take anything in the circle, fog or not. The Raptor's first missiles now land 11 seconds after the order and the Aurora's bomb after 9, and neither flies over the post first. Ground units still leave alone what they cannot see. A replay recorded before this change plays back differently.-- Search and destroy, a new order on F, sends the group round a circle you pick with the wheel, fighting everything it meets on the way, and leaves it guarding that circle when the lap is done. The lap starts on the side the group is coming from and skips ground you can already see. Where F is taken by a unit's own buttons the key moves to the next free place, and a card says what it does when you point at it.- H now sets a stance for the group. Defensive is how your units have always behaved: they fire on what comes into range and stay put. Aggressive lets them go after anything they can see, the way the computer's own units do, so a group left on aggressive clears the ground around it without being told. The button shows the stance the selection holds.- A queued attack move finishes its fights before the next order on the list goes out. The first enemy it met used to count as arriving, so a list of attack moves round a town skipped ahead a step at every skirmish and the group was off to the last point while the first was still contested. Replays recorded before this version play back differently.- A unit sent out to answer a shot, whose target then died, is supposed to walk home. When that walk cannot start, because the unit cannot move or the pathfinder has no way back, the failure was taken to mean someone was still in range, and the unit went back into the attack on a target that was already gone. Both ends of that attack find nobody and hand it back to the walk, which fails again, so the loop runs out inside the same step and starts over on the next one. One match wrote 67,416 lines about it, and every line is pushed out to disk as it is written. The failed walk now counts as the walk being over. The unit looks once more, and with nobody there it goes back to what it was doing. A save that caught the chase dropped it on load; it picks the target back up. A soldier whose tunnel is gone did the same thing, and a computer match wrote 80 of those lines. With no tunnel he waits and looks. A replay recorded before this change plays back differently.@@ -1830,6 +1829,7 @@ The whole HUD is on the hardware. Four colours carry it, and they mean the sameshadow trees have now is the opposite trick, and cost about thirty lines: the batch of trianglesthe trees are already drawn from, drawn a second time with the tree laid flat on its own base andslid along the sun. The shape comes free because it is the same triangles and the same texture.+- Search and destroy, the order on F that walked a group round a circle and left it guarding there, went out in v2.4.0 and is taken out again. An attack move and a guard do the same two halves with keys players already know, and the F place is back for the unit's own buttons. The Strategy Center's Search and Destroy battle plan is untouched.- Soldiers used to drop their posed shadow once the camera pulled far enough back to make each man afew pixels tall. It saved frame time in a big crowd and it made the army look flat at the zoommost games are played at, so it came out again: every soldier on screen keeps his shadow.diff --git a/GeneralsMD/Code/BuildFingerprint.manifest b/GeneralsMD/Code/BuildFingerprint.manifestindex 23f5b9728..26409d1d0 100644--- a/GeneralsMD/Code/BuildFingerprint.manifest+++ b/GeneralsMD/Code/BuildFingerprint.manifest@@ -214,7 +214,6 @@ Data/Scenarios/standinbuild.txtData/Scenarios/standinfake.txtData/Scenarios/stashbeside.txtData/Scenarios/statues.txt-Data/Scenarios/sweep.txtData/Scenarios/swhole.txtData/Scenarios/swpair.txtData/Scenarios/techrespawn.txtdiff --git a/GeneralsMD/Code/Data/Art/Textures/ReforgedOrders.tga b/GeneralsMD/Code/Data/Art/Textures/ReforgedOrders.tgaindex 6e5659e9d..2deb0b02f 100644Binary files a/GeneralsMD/Code/Data/Art/Textures/ReforgedOrders.tga and b/GeneralsMD/Code/Data/Art/Textures/ReforgedOrders.tga differdiff --git a/GeneralsMD/Code/Data/German/Generals.str b/GeneralsMD/Code/Data/German/Generals.strindex 12cc9f9ae..5c4d2616e 100644--- a/GeneralsMD/Code/Data/German/Generals.str+++ b/GeneralsMD/Code/Data/German/Generals.str@@ -14233,14 +14233,6 @@ GUI:OrderMoveDescription"Der nächste Klick auf den Boden schickt die ausgewählten Einheiten dorthin. Ziehe stattdessen, und sie verteilen sich entlang der gezogenen Linie."END-GUI:OrderSearchAndDestroy-"Suchen und Zerstören"-END--GUI:OrderSearchAndDestroyDescription-"Klicke auf eine Stelle, und die ausgewählten Einheiten gehen im Angriffsmarsch um sie herum, bekämpfen alles auf ihrem Weg und bewachen dann den ganzen Kreis. Drehe vor dem Klick das Mausrad, um den Kreis einzustellen."-END-GUI:OrderStanceDefensive"Haltung: Defensiv"ENDdiff --git a/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedOrders.ini b/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedOrders.iniindex 286a596f5..70d076703 100644--- a/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedOrders.ini+++ b/GeneralsMD/Code/Data/INI/MappedImages/HandCreated/ReforgedOrders.ini@@ -1,4 +1,4 @@-; The command bar's attack, hold position, move, search and destroy and stance cameos, painted+; The command bar's attack, hold position, move and stance cameos, painted; by Tools/order_cameos.py into Art/Textures/ReforgedOrders.tga. ControlBar.html draws them on the; page's order keys. Mapped images are not in the multiplayer INI checksum.@@ -26,14 +26,6 @@ MappedImage ReforgedOrderMoveStatus = NONEEnd-MappedImage ReforgedOrderHunt- Texture = ReforgedOrders.tga- TextureWidth = 256- TextureHeight = 128- Coords = Left:128 Top:0 Right:188 Bottom:48- Status = NONE-End-MappedImage ReforgedOrderAggressiveTexture = ReforgedOrders.tgaTextureWidth = 256diff --git a/GeneralsMD/Code/Data/Patch.str b/GeneralsMD/Code/Data/Patch.strindex b2ce1a7de..6ddd1ca9d 100644--- a/GeneralsMD/Code/Data/Patch.str+++ b/GeneralsMD/Code/Data/Patch.str@@ -220,14 +220,6 @@ GUI:OrderMoveDescription"The next click on the ground sends the selected units there. Drag instead and they spread out along the line you draw."END-GUI:OrderSearchAndDestroy-"Search and Destroy"-END--GUI:OrderSearchAndDestroyDescription-"Click a spot and the selected units attack move round it, fighting whatever they run into, then stay and guard the whole circle. Roll the mouse wheel before you click to size the circle."-END-GUI:OrderStanceDefensive"Stance: Defensive"ENDdiff --git a/GeneralsMD/Code/Data/Scenarios/sweep.txt b/GeneralsMD/Code/Data/Scenarios/sweep.txtdeleted file mode 100644index 166c3edd3..000000000--- a/GeneralsMD/Code/Data/Scenarios/sweep.txt+++ /dev/null@@ -1,31 +0,0 @@-# Does the search and destroy key cover the circle it is given?-#-# Two Crusaders west of a circle of 450 round 900,700, with an unarmed worker on-# the circle's ring at its north and its south. The verb hands the order queue the messages the key-# sends, an attack move to each point of the ring and a guard of the circle at the end, so both-# workers should die. Beside it, two more Crusaders given a plain attack move to the middle of the-# same kind of circle round 1450,1300 stop there: the ring is 315 out, past the 225 an attack move-# looks, so both of their workers should still be standing.-#-# generals.exe -headless -quickstart -noshellmap -observer -multiInstance -noFPSLimit-# -randommap 1 2 small -autoskirmish 2 -takeover-# -side 0 FactionAmerica -side 1 FactionGLA -seed 1 -maxframes 6000-# -scenario sweep -logPrefix sweep_-#-# See mobstress.txt for the line grammar.--30 spawn 0 AmericaTankCrusader 2 500 700 30-30 spawn 1 GLAInfantryWorker 1 900 385-30 spawn 1 GLAInfantryWorker 1 900 1015--30 spawn 0 SupW_AmericaTankCrusader 2 1100 1300 30-30 spawn 1 Chem_GLAInfantryWorker 1 1450 985-30 spawn 1 Chem_GLAInfantryWorker 1 1450 1615--60 hunt 0 AmericaTankCrusader 900 700 450-60 playerattackmove 0 SupW_AmericaTankCrusader 1450 1300--61 tally 1 GLAInfantryWorker-61 tally 1 Chem_GLAInfantryWorker-5980 tally 1 GLAInfantryWorker-5980 tally 1 Chem_GLAInfantryWorkerdiff --git a/GeneralsMD/Code/Data/Turkish/Generals.str b/GeneralsMD/Code/Data/Turkish/Generals.strindex 5c04c66e1..386c66cf4 100644--- a/GeneralsMD/Code/Data/Turkish/Generals.str+++ b/GeneralsMD/Code/Data/Turkish/Generals.str@@ -14829,14 +14829,6 @@ GUI:OrderMoveDescription"Zemine bir sonraki tıklama seçili birlikleri oraya gönderir. Bunun yerine sürüklerseniz birlikler çizdiğiniz çizgi boyunca dizilir."END-GUI:OrderSearchAndDestroy-"Ara ve Yok Et"-END--GUI:OrderSearchAndDestroyDescription-"Bir noktaya tıklayın; seçili birlikler çevresinde saldırarak ilerler, karşılarına çıkanla savaşır, sonra kalıp bütün daireyi korur. Daireyi boyutlandırmak için tıklamadan önce fare tekerleğini çevirin."-END-GUI:OrderStanceDefensive"Tutum: Savunmacı"ENDdiff --git a/GeneralsMD/Code/Data/Window/Html/ControlBar.html b/GeneralsMD/Code/Data/Window/Html/ControlBar.htmlindex 7b9c15481..2cafc222a 100644--- a/GeneralsMD/Code/Data/Window/Html/ControlBar.html+++ b/GeneralsMD/Code/Data/Window/Html/ControlBar.html@@ -51,8 +51,7 @@{{holdkey.x}} ... stand, data-click="order:attack", "order:hold" and "order:move", for a{{movekey.x}} ... selection that attack moves; no command set has a button for any ofthem. The game letters each with the key bound to its place- {{huntkey.x}} ... the search and destroy and stance keys, data-click="order:hunt" and- {{stancekey.x}} ... "order:stance", wherever the grid has room for them; {{stance}} is "aggressive" or "defensive", the first selected unit's+ {{stancekey.x}} ... the stance key, data-click="order:stance", wherever the grid has room for it; {{stance}} is "aggressive" or "defensive", the first selected unit'sdata-each="portraitcells" the selection's cells, the portrait's first and then only what itholds, each {{cell.x}} .y .w .h{{selinfo.x}} ... beside a lone unit's portrait: {{sel.name}}, data-each="selstars" a star@@ -316,7 +315,6 @@.order.attack { background-image: url(ReforgedOrderAttack); }.order.hold { background-image: url(ReforgedOrderHold); }.order.move { background-image: url(ReforgedOrderMove); }- .order.hunt { background-image: url(ReforgedOrderHunt); }.order.aggressive { background-image: url(ReforgedOrderAggressive); }.order.defensive { background-image: url(ReforgedOrderDefensive); }.order .glow { position: absolute; left: 0; top: 0; right: 0; bottom: 0; background-size: 100% 100%; background-repeat: no-repeat; }@@ -452,7 +450,6 @@<div class="piece order attack {{attackkey.shown}}" data-click="order:attack" style="left: {{attackkey.x}}px; top: {{attackkey.y}}px; width: {{attackkey.w}}px; height: {{attackkey.h}}px"><div class="glow"></div></div><div class="piece order hold {{holdkey.shown}}" data-click="order:hold" style="left: {{holdkey.x}}px; top: {{holdkey.y}}px; width: {{holdkey.w}}px; height: {{holdkey.h}}px"><div class="glow"></div></div><div class="piece order move {{movekey.shown}}" data-click="order:move" style="left: {{movekey.x}}px; top: {{movekey.y}}px; width: {{movekey.w}}px; height: {{movekey.h}}px"><div class="glow"></div></div>- <div class="piece order hunt {{huntkey.shown}}" data-click="order:hunt" style="left: {{huntkey.x}}px; top: {{huntkey.y}}px; width: {{huntkey.w}}px; height: {{huntkey.h}}px"><div class="glow"></div></div><div class="piece order {{stance}} {{stancekey.shown}}" data-click="order:stance" style="left: {{stancekey.x}}px; top: {{stancekey.y}}px; width: {{stancekey.w}}px; height: {{stancekey.h}}px"><div class="glow"></div></div><div class="piece commandcell" data-each="skillcells" style="left: {{cell.x}}px; top: {{cell.y}}px; width: {{cell.w}}px; height: {{cell.h}}px"><div class="edge" style="left: -{{ring}}px; top: -{{ring}}px; right: -{{ring}}px; bottom: -{{ring}}px; border-width: {{ring}}px"></div><div class="bevel"></div></div>diff --git a/GeneralsMD/Code/GameEngine/Include/Common/DrawnPath.h b/GeneralsMD/Code/GameEngine/Include/Common/DrawnPath.hindex 958fac7dd..e40df666c 100644--- a/GeneralsMD/Code/GameEngine/Include/Common/DrawnPath.h+++ b/GeneralsMD/Code/GameEngine/Include/Common/DrawnPath.h@@ -93,16 +93,4 @@ extern void orderAroundPoint( std::vector<AttackAssignSlot>& slots, Real centerX/// Either side empty writes nothing.extern void assignAttacks( Int attackerCount, Int targetCount, std::vector<AttackAssignPair>& pairs );-/// The points the search and destroy key walks round the circle the player put down:-/// on a ring at seven tenths of the radius, four on a small circle and up to eight on a wide one,-/// the first the one facing (fromX, fromY), where the selection stands, and the rest going round-/// clockwise. Each is held inside lo..hi. The ground height is not filled in.-extern void sweepPoints( Real centerX, Real centerY, Real radius, Real fromX, Real fromY,- Real loX, Real loY, Real hiX, Real hiY, std::vector<Coord3D>& out );--/// The same ring for one player on the map being played, on the ground, less the points that player-/// sees clear already; all of them when there is nothing left to look at.-extern void sweepRoute( Int playerIndex, const Coord3D& center, Real radius, const Coord3D& from,- std::vector<Coord3D>& route );-#endif // _H_DrawnPathdiff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.hindex 08b072e5e..b3559b4a6 100644--- a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h@@ -504,16 +504,14 @@ Bool ControlBar_commandPlaces( const Int *types, const Int *groups, const Int *p/** The page's keys past attack, hold position and move, which no command set has a button for either. */enum OrderKeyExtra{- ORDER_KEY_HUNT = 0, ///< search and destroy: attack move round a circle and guard it, for one that attack moves- ORDER_KEY_STANCE, ///< aggressive or defensive, for one that attack moves+ ORDER_KEY_STANCE = 0, ///< aggressive or defensive, for one that attack movesORDER_KEY_EXTRAS};/** Where the ORDER_KEY_EXTRAS keys stand once `count` slots are at `places` (ControlBar_commandPlaces'* answer, `fights` its return), or -1 for a key that is not offered or finds no room. They come- * after every button, so none of them moves one. Each has its own place, search and destroy F- * and the stance H; one that finds its own taken goes on B, then N, then the first free place in- * reading order. */+ * after every button, so none of them moves one. Each has its own place, the stance H; one that+ * finds its own taken goes on B, then N, then the first free place in reading order. */void ControlBar_orderKeyPlaces( const Int *places, Int count, Bool fights, Int *keys );enum { MAX_RIGHT_HUD_UPGRADE_CAMEOS = 5};enum { MAX_MULTI_SELECT_GROUPS = 36 }; ///< unit types a multi-selection tells apart (6x6 grid, Tab focus)@@ -903,7 +901,7 @@ public:attack and hold places hold the page's two orders. `places` has MAX_COMMANDS_PER_SET. */Bool getCommandPlaces( Int *places ) const;- /** Where the page's search and destroy and stance keys stand for what is selected now,+ /** Where the page's stance key stands for what is selected now,ORDER_KEY_EXTRAS of them, -1 for one that is not offered. See ControlBar_orderKeyPlaces. */void getOrderKeyPlaces( Int *keys ) const;diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.hindex 0476cf339..cb6813c35 100644--- a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h@@ -1262,9 +1262,9 @@ public: // ********************************************************************void setForceAttackMode( Bool enabled ) { m_forceAttackMode = enabled; }void setPreferSelectionMode( Bool enabled ) { m_preferSelection = enabled; }- void toggleAttackMoveToMode( void ) { m_attackMoveToMode = !m_attackMoveToMode; m_forceAttackArmed = FALSE; m_guardArmed = FALSE; m_moveArmed = FALSE; m_areaOrder = AREA_ORDER_NONE; }+ void toggleAttackMoveToMode( void ) { m_attackMoveToMode = !m_attackMoveToMode; m_forceAttackArmed = FALSE; m_guardArmed = FALSE; m_moveArmed = FALSE; }Bool isInAttackMoveToMode( void ) const { return m_attackMoveToMode; }- void clearAttackMoveToMode( void ) { m_attackMoveToMode = FALSE; m_forceAttackArmed = FALSE; m_guardArmed = FALSE; m_moveArmed = FALSE; m_areaOrder = AREA_ORDER_NONE; m_orderKeyKeptByShift = FALSE; }+ void clearAttackMoveToMode( void ) { m_attackMoveToMode = FALSE; m_forceAttackArmed = FALSE; m_guardArmed = FALSE; m_moveArmed = FALSE; m_orderKeyKeptByShift = FALSE; }// an order click with one of the three keys armed spends the key, unless shift is down: then it// stays armed for the next click, so a row of targets is one key and a row of clicks, and it drops@@ -1274,28 +1274,20 @@ public: // ********************************************************************// the attack key arms force fire the way the attack move key arms an attack move: the next// order click shoots whatever is under it, ground included, and the mode drops again with the// same call that drops attack move- void toggleForceAttackArmed( void ) { m_forceAttackArmed = !m_forceAttackArmed; m_attackMoveToMode = FALSE; m_guardArmed = FALSE; m_moveArmed = FALSE; m_areaOrder = AREA_ORDER_NONE; }+ void toggleForceAttackArmed( void ) { m_forceAttackArmed = !m_forceAttackArmed; m_attackMoveToMode = FALSE; m_guardArmed = FALSE; m_moveArmed = FALSE; }Bool isForceAttackArmed( void ) const { return m_forceAttackArmed; }- Bool isOrderKeyArmed( void ) const { return m_forceAttackArmed || m_attackMoveToMode || m_guardArmed || m_moveArmed || m_areaOrder != AREA_ORDER_NONE; } ///< the next left click is an attack, an attack move, a guard, a move or a sweep+ Bool isOrderKeyArmed( void ) const { return m_forceAttackArmed || m_attackMoveToMode || m_guardArmed || m_moveArmed; } ///< the next left click is an attack, an attack move, a guard or a moveBool isForceFireOn( void ) const; ///< the next order click force fires: the attack key armed it// and the guard key arms guard the same way: the next order click posts the selection on that// spot, or on that object, and a drag posts them along the line instead of stacking them all// on one point. All the armed keys are one mode at a time- void toggleGuardArmed( void ) { m_guardArmed = !m_guardArmed; m_attackMoveToMode = FALSE; m_forceAttackArmed = FALSE; m_moveArmed = FALSE; m_areaOrder = AREA_ORDER_NONE; }+ void toggleGuardArmed( void ) { m_guardArmed = !m_guardArmed; m_attackMoveToMode = FALSE; m_forceAttackArmed = FALSE; m_moveArmed = FALSE; }Bool isGuardArmed( void ) const { return m_guardArmed; }- // The search and destroy key (fork) arms a sweep the same way: the next order click is the centre- // of a circle, sized with the wheel like a guard's, and the selection attack moves round it and- // then guards the whole circle. It skips the ring's points the player already sees- enum AreaOrder { AREA_ORDER_NONE, AREA_ORDER_HUNT };- void toggleAreaOrderArmed( AreaOrder order );- AreaOrder getAreaOrderArmed( void ) const { return m_areaOrder; }- void issueAreaSweep( const Coord3D ¢er ); ///< the armed sweep's messages, round `center`-/** One of the page's keys past attack, hold position and move, an OrderKeyExtra (ControlBar.h),- * pressed with the mouse or its grid key: search and destroy arms its sweep, the- * stance key puts the selection on the other stance from the first unit's */+ * pressed with the mouse or its grid key: the stance key puts the selection on the other+ * stance from the first unit's */void pressOrderKey( Int key );// An order that covers a circle around the point it is given on (the guard key, EA's guard@@ -1308,7 +1300,7 @@ public: // ********************************************************************// the move key arms the order a right click gives, for the left button: the next order click is// that move, and a left drag draws the formation line- void toggleMoveArmed( void ) { m_moveArmed = !m_moveArmed; m_attackMoveToMode = FALSE; m_forceAttackArmed = FALSE; m_guardArmed = FALSE; m_areaOrder = AREA_ORDER_NONE; }+ 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@@ -1655,7 +1647,7 @@ protected:HtmlOverlay * m_promotionFrontOverlay; ///< the grid's frames, drawn over the promotionsHtmlOverlay * m_cellFrontOverlay[ CELL_GRID_COUNT ];std::vector< HtmlValues > m_cellFrontCells[ CELL_GRID_COUNT ]; ///< each grid's cells as the bar's page last placed them- enum { ORDER_KEYS = 5 }; ///< the page's attack, hold position and move keys, then the OrderKeyExtra ones+ enum { ORDER_KEYS = 4 }; ///< the page's attack, hold position and move keys, then the OrderKeyExtra onesIRegion2D m_orderKeyCell[ ORDER_KEYS ]; ///< where the page last put each, screen pixelsInt m_orderKeyPlace[ ORDER_KEYS ]; ///< the CommandPlace each stands on, -1 while it is not shownDisplayString * m_orderKeyString[ ORDER_KEYS ]; ///< each one's letter, on the command buttons' plate@@ -1942,8 +1934,7 @@ protected:Bool m_attackMoveToMode; ///< are we in attack move mode?Bool m_forceAttackArmed; ///< is the attack key holding force fire for the next click?Bool m_guardArmed; ///< is the guard key holding a guard order for the next click?- AreaOrder m_areaOrder; ///< the sweep the search and destroy key holds for the next click- Real m_areaPickScale; ///< what the wheel has made of the armed area order's default radius+ Real m_areaPickScale; ///< what the wheel has made of the armed guard's default radiusBool m_moveArmed; ///< is the move key holding a move for the next click?Bool m_orderKeyKeptByShift; ///< an armed key was clicked with under shift, and drops when shift comes upBool m_preferSelection; ///< the shift key has been depressed.diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/ScenarioDrill.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/ScenarioDrill.hindex f13491a61..424d05467 100644--- a/GeneralsMD/Code/GameEngine/Include/GameLogic/ScenarioDrill.h+++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/ScenarioDrill.h@@ -84,7 +84,6 @@ enum ScenarioActionTypeSCENARIO_ACTION_DOCK, ///< dock <slot> <selector> <targetSlot> <targetSelector>; a right click on a supply point or a dockSCENARIO_ACTION_CONSTRUCT, ///< construct <slot> <template> <position>; the local player's placement click, whatever is selected, as a message that is recorded and crosses the networkSCENARIO_ACTION_STANCE, ///< stance <slot> <selector> aggressive|defensive; the stance key, as MSG_SET_STANCE- SCENARIO_ACTION_HUNT, ///< hunt <slot> <selector> <position> [radius]; the search and destroy key's sweep, through the order queue as its messages arriveSCENARIO_ACTION_FORCEATTACK, ///< forceattack <slot> <selector> <targetSlot> <targetSelector>; the attack key's click on one unit, as MSG_DO_FORCE_ATTACK_OBJECTSCENARIO_ACTION_WEAPONAT, ///< weaponat <slot> <selector> <position> [primary|secondary|tertiary]; a FIRE_WEAPON button's click on the ground, as MSG_DO_WEAPON_AT_LOCATION; tertiary when left outSCENARIO_ACTION_FORCEGROUND, ///< forceground <slot> <selector> <position>; the attack key's click on the ground, as MSG_DO_FORCE_ATTACK_GROUNDdiff --git a/GeneralsMD/Code/GameEngine/Source/Common/DrawnPath.cpp b/GeneralsMD/Code/GameEngine/Source/Common/DrawnPath.cppindex da586b674..b6aae36c9 100644--- a/GeneralsMD/Code/GameEngine/Source/Common/DrawnPath.cpp+++ b/GeneralsMD/Code/GameEngine/Source/Common/DrawnPath.cpp@@ -22,9 +22,6 @@#include "Common/DrawnPath.h"#include "GameLogic/Object.h"-#include "GameLogic/PartitionManager.h"-#include "GameLogic/TerrainLogic.h"-#include "Lib/Trig.h"//-------------------------------------------------------------------------------------------------void buildPathArcLengths( const std::vector<Coord3D>& path, std::vector<Real>& arc )@@ -272,68 +269,3 @@ void assignAttacks( Int attackerCount, Int targetCount, std::vector<AttackAssign}}}--static const Real SWEEP_RING_SHARE = 0.7f; ///< the ring's radius as a share of the circle's-static const Real SWEEP_SPACING = 300.0f; ///< about how far apart two points stand along the ring-enum { SWEEP_POINTS_LEAST = 4, SWEEP_POINTS_MOST = 8 };--//--------------------------------------------------------------------------------------------------void sweepPoints( Real centerX, Real centerY, Real radius, Real fromX, Real fromY,- Real loX, Real loY, Real hiX, Real hiY, std::vector<Coord3D>& out )-{- out.clear();- const Real ring = radius * SWEEP_RING_SHARE;- const Int count = min( max( (Int)REAL_TO_INT_CEIL( TWO_PI * ring / SWEEP_SPACING ), (Int)SWEEP_POINTS_LEAST ),- (Int)SWEEP_POINTS_MOST );-- // a unit vector from the centre towards the selection, turned by one step for each point. A- // selection standing on the centre starts east- Real dx = fromX - centerX;- Real dy = fromY - centerY;- const Real length = sqrtf( dx * dx + dy * dy );- if( length < 1.0f )- {- dx = 1.0f;- dy = 0.0f;- }- else- {- dx /= length;- dy /= length;- }- const Real step = -TWO_PI / count;- const Real c = Cos( step );- const Real s = Sin( step );- for( Int i = 0; i < count; i++ )- {- Coord3D point;- point.x = min( max( centerX + dx * ring, loX ), hiX );- point.y = min( max( centerY + dy * ring, loY ), hiY );- point.z = 0.0f;- out.push_back( point );-- const Real turnedX = dx * c - dy * s;- dy = dx * s + dy * c;- dx = turnedX;- }-}--//--------------------------------------------------------------------------------------------------void sweepRoute( Int playerIndex, const Coord3D& center, Real radius, const Coord3D& from,- std::vector<Coord3D>& route )-{- Region3D extent;- TheTerrainLogic->getExtent( &extent );- std::vector<Coord3D> ring;- sweepPoints( center.x, center.y, radius, from.x, from.y, extent.lo.x, extent.lo.y, extent.hi.x, extent.hi.y, ring );-- route.clear();- for( std::vector<Coord3D>::iterator it = ring.begin(); it != ring.end(); ++it )- {- it->z = TheTerrainLogic->getGroundHeight( it->x, it->y );- if( ThePartitionManager->getShroudStatusForPlayer( playerIndex, &(*it) ) != CELLSHROUD_CLEAR )- route.push_back( *it );- }- if( route.empty() )- route = ring;-}diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cppindex c0434e3a2..f0c2f1bc9 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp@@ -392,7 +392,7 @@ void ControlBar_orderKeyPlaces( const Int *places, Int count, Bool fights, Int *taken[ places[ slot ] ] = TRUE;taken[ COMMAND_PLACE_ATTACK ] = taken[ COMMAND_PLACE_HOLD ] = taken[ COMMAND_PLACE_MOVE ] = TRUE;- static const Int OWN[ ORDER_KEY_EXTRAS ] = { COMMAND_PLACE_F, COMMAND_PLACE_H };+ static const Int OWN[ ORDER_KEY_EXTRAS ] = { COMMAND_PLACE_H };for( Int key = 0; key < ORDER_KEY_EXTRAS; key++ )if( !taken[ OWN[ key ] ] )keys[ key ] = OWN[ key ];@@ -484,7 +484,7 @@ void ControlBar::pressCommandButton( Int place )if( place < 0 || place >= COMMAND_PLACE_COUNT )return;- // the page's search and destroy and stance keys stand where no button does+ // the page's stance key stands where no button doesInt keys[ ORDER_KEY_EXTRAS ];getOrderKeyPlaces( keys );for( Int key = 0; key < ORDER_KEY_EXTRAS; key++ )diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cppindex b6cbe9d19..b24f0c512 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp@@ -1355,7 +1355,6 @@ InGameUI::InGameUI()m_attackMoveToMode = false;m_forceAttackArmed = false;m_guardArmed = false;- m_areaOrder = AREA_ORDER_NONE;m_areaPickScale = 1.0f;m_moveArmed = false;m_orderKeyKeptByShift = false;@@ -4391,7 +4390,6 @@ void InGameUI::reset( void )m_attackMoveToMode = false;m_forceAttackArmed = false;m_guardArmed = false;- m_areaOrder = AREA_ORDER_NONE;m_areaPickScale = 1.0f;m_moveArmed = false;m_orderKeyKeptByShift = false;@@ -7086,8 +7084,6 @@ void InGameUI::createCommandHint( const GameMessage *msg ){if( !drawSelectable && srcObj && srcObj->isLocallyControlled() && srcObj->isKindOf(KINDOF_STRUCTURE))setMouseCursor( Mouse::GENERIC_INVALID );- else if( m_areaOrder != AREA_ORDER_NONE )- setMouseCursor( Mouse::CROSS ); // a sweep circles the point whatever stands on it, own units includedelse if( drawSelectable && obj->isLocallyControlled() && !obj->isKindOf(KINDOF_MINE))setMouseCursor( Mouse::SELECTING );else if( TheRadar->isRadarWindow( window ) &&@@ -7841,11 +7837,9 @@ void InGameUI::adjustPlacementRowGap( Real spin )static const Real AREA_PICK_RADIUS_MIN = 50.0f;static const Real AREA_PICK_STEP = 1.15f; ///< what one notch of the wheel multiplies the radius by-static const Real AREA_SWEEP_RADIUS = 300.0f; ///< a search and destroy's circle before the wheel//--------------------------------------------------------------------------------------------------/** The guard key, the search and destroy key, or one of EA's guard buttons waiting for- * its click. */+/** The guard key, or one of EA's guard buttons waiting for its click. *///-------------------------------------------------------------------------------------------------Bool InGameUI::isAreaPicking( void ) const{@@ -7853,7 +7847,7 @@ Bool InGameUI::isAreaPicking( void ) constif( TheGlobalData->isClassicUI() )return FALSE;- if( m_guardArmed || m_areaOrder != AREA_ORDER_NONE )+ if( m_guardArmed )return TRUE;const CommandButton *command = m_pendingGUICommand;@@ -7865,14 +7859,10 @@ Bool InGameUI::isAreaPicking( void ) const//-------------------------------------------------------------------------------------------------/** The radius the armed order starts from before the wheel touches it. A guard used to cover* each unit's own vision, so riflemen and rocket troops on one spot held two different circles;- * the whole selection now takes the widest of them. A sweep's circle is the ground to cover, which- * has nothing to do with how far its units see, so it starts the same for every selection. */+ * the whole selection now takes the widest of them. *///--------------------------------------------------------------------------------------------------static Real areaPickBaseRadius( const DrawableList& selected, Bool sweeping )+static Real areaPickBaseRadius( const DrawableList& selected ){- if( sweeping )- return AREA_SWEEP_RADIUS;-Real widest = 0.0f;for( DrawableList::const_iterator it = selected.begin(); it != selected.end(); ++it ){@@ -7886,7 +7876,7 @@ static Real areaPickBaseRadius( const DrawableList& selected, Bool sweeping )//-------------------------------------------------------------------------------------------------Real InGameUI::getAreaPickRadius( void ) const{- const Real radius = areaPickBaseRadius( m_selectedDrawables, m_areaOrder != AREA_ORDER_NONE ) * m_areaPickScale;+ const Real radius = areaPickBaseRadius( m_selectedDrawables ) * m_areaPickScale;return min( max( radius, AREA_PICK_RADIUS_MIN ), GUARD_RADIUS_MAX );}@@ -7897,7 +7887,7 @@ Real InGameUI::getAreaPickRadius( void ) const//-------------------------------------------------------------------------------------------------void InGameUI::adjustAreaPickRadius( Real notches ){- const Real base = areaPickBaseRadius( m_selectedDrawables, m_areaOrder != AREA_ORDER_NONE );+ const Real base = areaPickBaseRadius( m_selectedDrawables );if( base <= 0.0f )return;@@ -7905,17 +7895,6 @@ void InGameUI::adjustAreaPickRadius( Real notches )m_areaPickScale = min( max( m_areaPickScale, AREA_PICK_RADIUS_MIN / base ), GUARD_RADIUS_MAX / base );}-//--------------------------------------------------------------------------------------------------void InGameUI::toggleAreaOrderArmed( AreaOrder order )-{- m_areaOrder = ( m_areaOrder == order ) ? AREA_ORDER_NONE : order;- m_areaPickScale = 1.0f;- m_attackMoveToMode = FALSE;- m_forceAttackArmed = FALSE;- m_guardArmed = FALSE;- m_moveArmed = FALSE;-}-//-------------------------------------------------------------------------------------------------/** The first unit of the player's in the selection with a stance to read, for the stance key's face* and for which stance a press switches the selection to. */@@ -7935,62 +7914,13 @@ static Bool isSelectionAggressive( void )//-------------------------------------------------------------------------------------------------void InGameUI::pressOrderKey( Int key ){- if( key == ORDER_KEY_HUNT )- toggleAreaOrderArmed( AREA_ORDER_HUNT );- else if( key == ORDER_KEY_STANCE && getSelectCount() > 0 )+ if( key == ORDER_KEY_STANCE && getSelectCount() > 0 ){GameMessage *stance = TheMessageStream->appendMessage( GameMessage::MSG_SET_STANCE );stance->appendIntegerArgument( isSelectionAggressive() ? 0 : 1 );}}-//--------------------------------------------------------------------------------------------------/** The ring is walked from the point nearest the selection, each point an order of its own on the- * units' list (OrderQueue.h): the first replaces what they were doing, unless shift puts the whole- * sweep behind it. Search and destroy attack moves the ring, so it fights what it meets, and- * ends guarding the circle it was given. */-//--------------------------------------------------------------------------------------------------void InGameUI::issueAreaSweep( const Coord3D ¢er )-{- const DrawableList *selected = getAllSelectedLocalDrawables();- Coord3D from;- from.zero();- Int count = 0;- for( DrawableListCIt it = selected->begin(); it != selected->end(); ++it )- {- const Object *obj = (*it)->getObject();- if( obj == NULL )- continue;- from.x += obj->getPosition()->x;- from.y += obj->getPosition()->y;- count++;- }- if( count == 0 )- return;- from.x /= count;- from.y /= count;-- const Real radius = getAreaPickRadius();- std::vector<Coord3D> route;- sweepRoute( ThePlayerList->getLocalPlayer()->getPlayerIndex(), center, radius, from, route );-- const GameMessage::Type step = GameMessage::MSG_DO_ATTACKMOVETO;- for( size_t i = 0; i < route.size(); i++ )- {- markNextOrderQueued( ( i == 0 && !isInWaypointMode() ) ? ORDER_QUEUE_FRESH : ORDER_QUEUE_APPEND );- TheMessageStream->appendMessage( step )->appendLocationArgument( route[ i ] );- }- markNextOrderQueued( ORDER_QUEUE_APPEND );- GameMessage *guard = TheMessageStream->appendMessage( GameMessage::MSG_DO_GUARD_POSITION );- guard->appendLocationArgument( center );- guard->appendIntegerArgument( GUARDMODE_NORMAL );- guard->appendRealArgument( radius );-- pickAndPlayUnitVoiceResponse( selected, step );- DEBUG_LOG(( "area sweep: hunt round (%.0f,%.0f) radius %.0f, %d points, %d units\n",- center.x, center.y, radius, (Int)route.size(), count ));-}-//-------------------------------------------------------------------------------------------------/** Every piece faces 'angle', the heading on the ghost before the drag began: the drag is spent on* the row, so it cannot aim as well. The row stops where the money does, which is what the logic@@ -13096,8 +13026,7 @@ static void armSignalFromPage( const std::string &kind )//-------------------------------------------------------------------------------------------------/** data-click="order:attack", "order:hold" or "order:move", the command panel's orders no command set* has a button for: what the A, C and V keys do, force fire armed for the next click, hold position,- * and a move armed for the next click. "order:hunt" and "order:stance" are the keys after them,- * pressOrderKey's. */+ * and a move armed for the next click. "order:stance" is the key after them, pressOrderKey's. *///-------------------------------------------------------------------------------------------------static void orderFromPage( const std::string &order ){@@ -13105,8 +13034,6 @@ static void orderFromPage( const std::string &order )TheInGameUI->toggleForceAttackArmed();else if( order == "move" )TheInGameUI->toggleMoveArmed();- else if( order == "hunt" )- TheInGameUI->pressOrderKey( ORDER_KEY_HUNT );else if( order == "stance" )TheInGameUI->pressOrderKey( ORDER_KEY_STANCE );else if( order == "hold" && TheInGameUI->getSelectCount() > 0 )@@ -14034,7 +13961,7 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, I// attack, hold position and move have no button in any command set: the page's keys do what A, C// and V do, for anything that attack movestaken[ COMMAND_PLACE_ATTACK ] = taken[ COMMAND_PLACE_HOLD ] = taken[ COMMAND_PLACE_MOVE ] = fights;- // and search and destroy and the stance key wherever there is room for them+ // and the stance key wherever there is room for itInt extraKeys[ ORDER_KEY_EXTRAS ];TheControlBar->getOrderKeyPlaces( extraKeys );for( Int key = 0; key < ORDER_KEY_EXTRAS; key++ )@@ -14171,9 +14098,9 @@ Bool InGameUI::drawControlBarPage( const IRegion2D *panels, const Bool *shown, Iif( where[ button ] >= 0 )TheControlBar->placeWindowAt( numberedWindow( "ButtonCommand", button + 1 ), place[ where[ button ] ] );// the page's own keys; their letters are drawCellGridFront's, on the command buttons' own plate- static const char *const ORDER_KEY_NAMES[ ORDER_KEYS ] = { "attackkey", "holdkey", "movekey", "huntkey", "stancekey" };+ static const char *const ORDER_KEY_NAMES[ ORDER_KEYS ] = { "attackkey", "holdkey", "movekey", "stancekey" };const Int orderKeyPlaces[ ORDER_KEYS ] = { fights ? COMMAND_PLACE_ATTACK : -1, fights ? COMMAND_PLACE_HOLD : -1,- fights ? COMMAND_PLACE_MOVE : -1, extraKeys[ ORDER_KEY_HUNT ], extraKeys[ ORDER_KEY_STANCE ] };+ fights ? COMMAND_PLACE_MOVE : -1, extraKeys[ ORDER_KEY_STANCE ] };for( Int key = 0; key < ORDER_KEYS; key++ ){m_orderKeyPlace[ key ] = centreShown ? orderKeyPlaces[ key ] : -1;@@ -16717,11 +16644,11 @@ Bool InGameUI::drawTooltipPage( const UnicodeString &cursorText, const RGBColorconst ICoord2D &mouse = TheMouse->getMouseStatus()->pos;const BuildTooltipCard *card = TheControlBar->getBuildTooltipCard();- // the attack, hold position and move keys and the two after them are the page's own, with no+ // the attack, hold position and move keys and the stance key after them are the page's own, with no// window behind them for the bar's tooltip to find, so their cards are made here and stand on the// console as a button's does. The stance key's card names the stance the selection is onstatic const char *const ORDER_KEY_LABELS[ ORDER_KEYS ] = { "GUI:OrderForceAttack", "GUI:OrderHoldPosition", "GUI:OrderMove",- "GUI:OrderSearchAndDestroy", "GUI:OrderStanceDefensive" };+ "GUI:OrderStanceDefensive" };BuildTooltipCard orderCard = BuildTooltipCard();if( m_controlBarPageShown && !areTooltipsDisabled() && !isQuitMenuVisible() ){diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cppindex 11ac736c0..983800662 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp@@ -1624,16 +1624,6 @@ GameMessage::Type CommandTranslator::evaluateContextCommand( Drawable *draw,const Coord3D *pos,CommandEvaluateType type ){- // the search and destroy key sweeps a circle round the point, whatever stands on it- if( TheInGameUI->getAreaOrderArmed() != InGameUI::AREA_ORDER_NONE && TheInGameUI->areSelectedObjectsControllable() )- {- if( type == DO_COMMAND )- TheInGameUI->issueAreaSweep( *pos );- else if( type == DO_HINT )- TheMessageStream->appendMessage( GameMessage::MSG_DO_MOVETO_HINT )->appendLocationArgument( *pos );- return type == DO_COMMAND ? GameMessage::MSG_DO_MOVETO : GameMessage::MSG_DO_MOVETO_HINT;- }-Object *obj = draw ? draw->getObject() : NULL;Drawable *drawableInWay = draw;diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cppindex 53c1da361..8aef6cbdf 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp@@ -430,12 +430,9 @@ 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. Search and destroy has no line to draw, and its drag- // is no box either: the key stays armed for the click that aims it- // Classic draws no lines: its left drag is always the box+ // no selection box grows under it. Classic draws no lines: its left drag is always the boxconst Bool leftDragIsOrder = !TheGlobalData->isClassicUI()- && (TheInGameUI->isLineOrderArmed()- || TheInGameUI->getAreaOrderArmed() != InGameUI::AREA_ORDER_NONE)+ && TheInGameUI->isLineOrderArmed()&& TheInGameUI->getSelectCount() > 0;if (m_leftMouseButtonIsDown && !leftDragIsOrder){diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/OrderQueue.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/OrderQueue.cppindex 50f28d4c0..d07e97f2d 100644--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/OrderQueue.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/OrderQueue.cpp@@ -215,7 +215,7 @@ static Bool OrderQueue_isUsingAbility( const Object *obj )* about is not one: the group is done, and the next order takes it off that fight. Nor is a* guard, which never ends. A fight an attack move stopped for is the order itself, though it* marks itself the AI's while it lasts: without this a queued attack move ended the moment it met- * anybody, and a search and destroy skipped the rest of its ring at the first enemy. */+ * anybody. *///-------------------------------------------------------------------------------------------------static Bool OrderQueue_isWorking( const Object *obj, const AIUpdateInterface *ai ){diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/ScenarioDrill.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/ScenarioDrill.cppindex a941cef1b..74541655d 100644--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/ScenarioDrill.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/ScenarioDrill.cpp@@ -26,7 +26,6 @@#include "PreRTS.h" // This must go first in EVERY cpp file int the GameEngine#include "Common/BuildAssistant.h"-#include "Common/DrawnPath.h"#include "Common/file.h"#include "Common/FileSystem.h"#include "Common/GlobalData.h"@@ -95,9 +94,6 @@ static const Int SCENARIO_SHIFTPOWER_NAME_TOKEN = 6;static const Int SCENARIO_SHIFTUPGRADE_NAME_TOKEN = 4;static const Int SCENARIO_STANCE_NAME_TOKEN = 4;-/// a hunt's circle when the line does not say, the key's own before the wheel-static const Real SCENARIO_DEFAULT_SWEEP_RADIUS = 300.0f;-// where the position starts in each line that has onestatic const Int SCENARIO_SPAWN_POSITION_TOKEN = 5;static const Int SCENARIO_ORDER_POSITION_TOKEN = 4;@@ -217,8 +213,6 @@ static Bool parseActionType( const AsciiString &token, ScenarioActionType *actio*action = SCENARIO_ACTION_CONSTRUCT;else if (token == "stance")*action = SCENARIO_ACTION_STANCE;- else if (token == "hunt")- *action = SCENARIO_ACTION_HUNT;else if (token == "forceattack")*action = SCENARIO_ACTION_FORCEATTACK;else if (token == "weaponat")@@ -309,7 +303,6 @@ static Int tokensNeededFor( ScenarioActionType action )case SCENARIO_ACTION_SHIFTATTACKMOVE: return SCENARIO_TOKENS_MOVE;case SCENARIO_ACTION_SHIFTGUARD: return SCENARIO_TOKENS_MOVE;case SCENARIO_ACTION_CONSTRUCT: return SCENARIO_TOKENS_MOVE;- case SCENARIO_ACTION_HUNT: return SCENARIO_TOKENS_MOVE;case SCENARIO_ACTION_WEAPONAT: return SCENARIO_TOKENS_MOVE;case SCENARIO_ACTION_FORCEGROUND: return SCENARIO_TOKENS_MOVE;case SCENARIO_ACTION_RESPOND: return SCENARIO_TOKENS_MOVE;@@ -395,7 +388,6 @@ ScenarioParseResult ScenarioDrill_parseLine( const char *line, ScenarioAction *acase SCENARIO_ACTION_SHIFTATTACKMOVE:case SCENARIO_ACTION_SHIFTGUARD:case SCENARIO_ACTION_CONSTRUCT:- case SCENARIO_ACTION_HUNT:case SCENARIO_ACTION_WEAPONAT:case SCENARIO_ACTION_FORCEGROUND:case SCENARIO_ACTION_RESPOND:@@ -410,8 +402,6 @@ ScenarioParseResult ScenarioDrill_parseLine( const char *line, ScenarioAction *aif (action->name != "primary" && action->name != "secondary" && action->name != "tertiary")return SCENARIO_PARSE_BAD_ACTION;}- if (actionType == SCENARIO_ACTION_HUNT)- action->radius = (count > next) ? (Real)atof( tokens[ next ].str() ) : SCENARIO_DEFAULT_SWEEP_RADIUS;if (actionType == SCENARIO_ACTION_ARRIVE && count > next)action->radius = (Real)atof( tokens[ next ].str() );if (actionType == SCENARIO_ACTION_SHIFTGUARD)@@ -1517,57 +1507,6 @@ static Bool executeWeaponAt( const ScenarioAction &action, Player *player, constreturn TRUE;}-/** The search and destroy key: the ring sweepRoute gives this seat round the point, from where the- units stand, each point handed to the order queue the way the key's messages arrive - the first- fresh, the rest behind it - and then a guard of the whole circle. Each message gets a group of- its own, because the queue destroys the one it takes. */-static Bool executeSweep( const ScenarioAction &action, Player *player, const Coord3D ¢er, AIGroup *group, Int taken )-{- Coord3D from;- from.zero();- const VecObjectID ids = group->getAllIDs();- for( VecObjectID::const_iterator it = ids.begin(); it != ids.end(); ++it )- {- const Object *obj = TheGameLogic->findObjectByID( *it );- from.x += obj->getPosition()->x;- from.y += obj->getPosition()->y;- }- from.x /= taken;- from.y /= taken;- TheAI->destroyGroup( group );-- std::vector<Coord3D> route;- sweepRoute( player->getPlayerIndex(), center, action.radius, from, route );- route.push_back( center );-- for( size_t i = 0; i < route.size(); i++ )- {- const Bool last = i + 1 == route.size();- const GameMessage::Type type = last ? GameMessage::MSG_DO_GUARD_POSITION : GameMessage::MSG_DO_ATTACKMOVETO;- GameMessage *msg = newInstance( GameMessage )( type );- msg->friend_setPlayerIndex( player->getPlayerIndex() );- msg->appendLocationArgument( route[ i ] );- if( type == GameMessage::MSG_DO_GUARD_POSITION )- {- msg->appendIntegerArgument( GUARDMODE_NORMAL );- msg->appendRealArgument( action.radius );- }-- AIGroup *members = TheAI->createGroup();- gatherIntoGroup( player, action.selector, members );- player->getOrderQueue()->setNextOrderMode( i == 0 ? ORDER_QUEUE_FRESH : ORDER_QUEUE_APPEND );- player->getOrderQueue()->takeMessage( msg, members, player );- msg->deleteInstance();-- DEBUG_LOG(("SCENARIO: frame %d hunt slot %d '%s' step %d of %d at (%.0f,%.0f)\n", action.frame,- action.slot, action.selector.str(), (Int)i + 1, (Int)route.size(), route[ i ].x, route[ i ].y));- }-- DEBUG_LOG(("SCENARIO: frame %d hunt slot %d '%s' x%d round (%.0f,%.0f) radius %.0f\n", action.frame,- action.slot, action.selector.str(), taken, center.x, center.y, action.radius));- return TRUE;-}-static Bool executeOrder( const ScenarioAction &action, Player *player, const Coord3D &dest ){if (action.action == SCENARIO_ACTION_SHIFTUPGRADE)@@ -1671,9 +1610,6 @@ static Bool executeOrder( const ScenarioAction &action, Player *player, const Coreturn TRUE;}- case SCENARIO_ACTION_HUNT:- return executeSweep( action, player, dest, group, taken ); // and so does this-case SCENARIO_ACTION_STOP:{group->groupIdle( CMD_FROM_SCRIPT );diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cppindex b488d9362..cd93196e8 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp@@ -715,15 +715,12 @@ void W3DInGameUI::draw( void )drawGuardMarkers();// the circle an armed guard will hold, under the cursor, at the size the wheel left it. A drag- // is drawing a guard line instead, where every unit holds its own station. A search and- // destroy's circle is the attack move colour, as its hint is+ // is drawing a guard line instead, where every unit holds its own stationif( isAreaPicking() && !m_isFormationDragging ){Coord3D center;TheTacticalView->screenToTerrain( &TheMouse->getMouseStatus()->pos, ¢er );- const UnsignedInt color = getAreaOrderArmed() == AREA_ORDER_HUNT ? 0xCCFF66CC- : 0xCC55CCFF; // the guard blue the hints use- drawGroundRing( center, getAreaPickRadius(), color, 2.0f );+ drawGroundRing( center, getAreaPickRadius(), 0xCC55CCFF, 2.0f ); // the guard blue the hints use}// for each view draw hintsdiff --git a/GeneralsMD/Code/Tests/test_gameengine.cpp b/GeneralsMD/Code/Tests/test_gameengine.cppindex 16601ffb3..5029ab44e 100644--- a/GeneralsMD/Code/Tests/test_gameengine.cpp+++ b/GeneralsMD/Code/Tests/test_gameengine.cpp@@ -3785,7 +3785,7 @@ TEST(controlbar_command_places_go_in_rows_by_what_they_are_for)CHECK_EQ( places[ slot ], manyPlaces[ slot ] );}-TEST(controlbar_hunt_and_stance_keys_take_what_the_buttons_leave)+TEST(controlbar_stance_key_takes_what_the_buttons_leave){enum { SLOTS = 14 };Int places[ SLOTS ];@@ -3793,34 +3793,30 @@ TEST(controlbar_hunt_and_stance_keys_take_what_the_buttons_leave)const Int N = GUI_COMMAND_NONE, ab = COMMAND_GROUP_ABILITY, pa = COMMAND_GROUP_PASSENGER;const Int nothingPinned[ SLOTS ] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };- /* a Ranger: two abilities, attack move, guard, stop. Search and destroy on F and the stance on H,- their own places */+ /* a Ranger: two abilities, attack move, guard, stop. The stance on H, its own place */const Int ranger[ SLOTS ] = { GUI_COMMAND_FIRE_WEAPON, GUI_COMMAND_SPECIAL_POWER, N, N, N, N, N, N, N, N,GUI_COMMAND_ATTACK_MOVE, N, GUI_COMMAND_GUARD, GUI_COMMAND_STOP };const Int rangerGroups[ SLOTS ] = { ab, ab, ab, ab, ab, ab, ab, ab, ab, ab, ab, ab, ab, ab };Bool fights = ControlBar_commandPlaces( ranger, rangerGroups, nothingPinned, SLOTS, places );CHECK( fights );ControlBar_orderKeyPlaces( places, SLOTS, fights, keys );- CHECK_EQ( keys[ ORDER_KEY_HUNT ], (Int)COMMAND_PLACE_F );CHECK_EQ( keys[ ORDER_KEY_STANCE ], (Int)COMMAND_PLACE_H );/* the Humvee's set, as in the test above: passengers hold F G H B N and the drones Q W E, so the- two go on in reading order, R T, and never move a button */+ stance goes on in reading order, R, and never moves a button */const Int humvee[ SLOTS ] = { GUI_COMMAND_OBJECT_UPGRADE, GUI_COMMAND_OBJECT_UPGRADE, GUI_COMMAND_OBJECT_UPGRADE,GUI_COMMAND_EXIT_CONTAINER, GUI_COMMAND_EXIT_CONTAINER, GUI_COMMAND_EXIT_CONTAINER, GUI_COMMAND_EXIT_CONTAINER,GUI_COMMAND_EXIT_CONTAINER, GUI_COMMAND_EVACUATE, N, GUI_COMMAND_ATTACK_MOVE, N, GUI_COMMAND_GUARD, GUI_COMMAND_STOP };const Int humveeGroups[ SLOTS ] = { ab, ab, ab, pa, pa, pa, pa, pa, ab, ab, ab, ab, ab, ab };fights = ControlBar_commandPlaces( humvee, humveeGroups, nothingPinned, SLOTS, places );ControlBar_orderKeyPlaces( places, SLOTS, fights, keys );- CHECK_EQ( keys[ ORDER_KEY_HUNT ], (Int)COMMAND_PLACE_R );- CHECK_EQ( keys[ ORDER_KEY_STANCE ], (Int)COMMAND_PLACE_T );+ CHECK_EQ( keys[ ORDER_KEY_STANCE ], (Int)COMMAND_PLACE_R );- /* a Radar Van: a scan and an upgrade, nothing to attack move with, so neither key */+ /* a Radar Van: a scan and an upgrade, nothing to attack move with, so no stance key */const Int van[ SLOTS ] = { GUI_COMMAND_SPECIAL_POWER, GUI_COMMAND_OBJECT_UPGRADE, N, N, N, N, N, N, N, N, N, N, N, GUI_COMMAND_STOP };fights = ControlBar_commandPlaces( van, rangerGroups, nothingPinned, SLOTS, places );CHECK( !fights );ControlBar_orderKeyPlaces( places, SLOTS, fights, keys );- CHECK_EQ( keys[ ORDER_KEY_HUNT ], -1 );CHECK_EQ( keys[ ORDER_KEY_STANCE ], -1 );/* a grid with no room: every key stays off it */@@ -3832,35 +3828,6 @@ TEST(controlbar_hunt_and_stance_keys_take_what_the_buttons_leave)CHECK_EQ( keys[ key ], -1 );}-/* The search and destroy key walks a ring at seven tenths of the circle, starting on the- side the selection stands and going round clockwise, four to eight points by size, never off the map. */-TEST(sweep_points_go_round_the_ring_from_the_selection_side)-{- std::vector<Coord3D> points;- sweepPoints( 1000.0f, 1000.0f, 300.0f, 1000.0f, 0.0f, 0.0f, 0.0f, 4000.0f, 4000.0f, points );- CHECK_EQ( (Int)points.size(), 5 ); // 2 pi 210 / 300 is 4.4- CHECK_NEAR( points[ 0 ].x, 1000.0f, 0.01f );- CHECK_NEAR( points[ 0 ].y, 790.0f, 0.01f );- // clockwise from six o'clock is towards nine- CHECK( points[ 1 ].x < 1000.0f - 150.0f );- for( size_t i = 0; i < points.size(); i++ )- {- const Real dx = points[ i ].x - 1000.0f, dy = points[ i ].y - 1000.0f;- CHECK_NEAR( (Real)sqrt( dx * dx + dy * dy ), 210.0f, 0.5f );- }-- sweepPoints( 1000.0f, 1000.0f, 50.0f, 1000.0f, 1000.0f, 0.0f, 0.0f, 4000.0f, 4000.0f, points );- CHECK_EQ( (Int)points.size(), 4 );- CHECK_NEAR( points[ 0 ].x, 1035.0f, 0.01f ); // standing on the centre starts east- sweepPoints( 1000.0f, 1000.0f, 800.0f, 0.0f, 0.0f, 0.0f, 0.0f, 4000.0f, 4000.0f, points );- CHECK_EQ( (Int)points.size(), 8 );-- // a circle on the map's corner keeps every point on the map- sweepPoints( 50.0f, 50.0f, 400.0f, 500.0f, 500.0f, 0.0f, 0.0f, 4000.0f, 4000.0f, points );- for( size_t i = 0; i < points.size(); i++ )- CHECK( points[ i ].x >= 0.0f && points[ i ].y >= 0.0f );-}-/* The money plate follows its figure's width: wider at once, narrower only once the narrower figurehas held for MONEY_SHRINK_HOLD_MS, and then eased down over MONEY_SHRINK_EASE_MS. */TEST(the_money_plate_grows_at_once_and_shrinks_only_after_a_hold)@@ -15899,18 +15866,13 @@ TEST(scenario_parses_the_order_lines)CHECK_STR( action.selector.str(), "ChinaGattlingCannon" );CHECK_EQ( (Int)ScenarioDrill_parseLine( "1800 tally 1", &action ), (Int)SCENARIO_PARSE_MISSING_ARGS );- // the stance key, and the sweep with the key's own circle unless the line sizes it+ // the stance keyCHECK_EQ( (Int)ScenarioDrill_parseLine( "60 stance 0 AmericaTankCrusader aggressive", &action ), (Int)SCENARIO_PARSE_OK );CHECK_EQ( (Int)action.action, (Int)SCENARIO_ACTION_STANCE );CHECK_STR( action.name.str(), "aggressive" );CHECK_EQ( (Int)ScenarioDrill_parseLine( "60 stance 0 * bold", &action ), (Int)SCENARIO_PARSE_BAD_ACTION );CHECK_EQ( (Int)ScenarioDrill_parseLine( "60 stance 0 *", &action ), (Int)SCENARIO_PARSE_MISSING_ARGS );- CHECK_EQ( (Int)ScenarioDrill_parseLine( "60 hunt 0 * 900 700", &action ), (Int)SCENARIO_PARSE_OK );- CHECK_EQ( (Int)action.action, (Int)SCENARIO_ACTION_HUNT );- CHECK( action.radius == 300.0f );- CHECK_EQ( (Int)ScenarioDrill_parseLine( "60 hunt 0 * 900 700 450", &action ), (Int)SCENARIO_PARSE_OK );- CHECK_EQ( (Int)action.action, (Int)SCENARIO_ACTION_HUNT );- CHECK( action.radius == 450.0f );+ CHECK_EQ( (Int)ScenarioDrill_parseLine( "60 hunt 0 * 900 700", &action ), (Int)SCENARIO_PARSE_BAD_ACTION );CHECK_EQ( (Int)ScenarioDrill_parseLine( "700 power 1 GLAScudStorm start0:0:300", &action ),(Int)SCENARIO_PARSE_OK );diff --git a/GeneralsMD/Code/Tools/order_cameos.py b/GeneralsMD/Code/Tools/order_cameos.pyindex 271194ab7..3ff14dc97 100644--- a/GeneralsMD/Code/Tools/order_cameos.py+++ b/GeneralsMD/Code/Tools/order_cameos.py@@ -1,12 +1,12 @@-"""The command bar's attack, hold position, move, search and destroy and stance cameos,+"""The command bar's attack, hold position, move and stance cameos,painted in the manner of EA's command cameos (SSStop, SSGuard): a sign with a bevelled steel rim andfour bolts standing over a painted backdrop. No command set has a button for any of these orders,so the game has no picture for them.Attack is a red plate with a white crosshair over a burning sky, hold position a blue plate with a-raised palm over a blue one, move a green diamond with a white arrow over an overcast field. Search-and destroy is an orange plate with a magnifying glass over a dusk sky, the aggressive stance a red-pennant of two chevrons pointing ahead and the defensive one a steel blue shield. Each is painted at four times its size and brought down,+raised palm over a blue one, move a green diamond with a white arrow over an overcast field. The+aggressive stance is a red pennant of two chevrons pointing ahead and the defensive one a steel blue+shield. Each is painted at four times its size and brought down,which iswhat softens the edges into the look of the shipped art. The noise is seeded, so the file comesout the same every time.@@ -26,7 +26,7 @@ from PIL import Image, ImageDraw, ImageFilterCAMEO_W, CAMEO_H = 60, 48 # every command cameo in the shipped mapped imagesSUPER = 4 # painted at this many times the sizeTEXTURE_W, TEXTURE_H = 256, 128-CAMEO_PLACES = {"attack": (0, 0), "hold": (64, 0), "move": (0, 64), "hunt": (128, 0),+CAMEO_PLACES = {"attack": (0, 0), "hold": (64, 0), "move": (0, 64),"aggressive": (192, 0), "defensive": (128, 64)}SEED = 20260928OUT_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "Data", "Art", "Textures", "ReforgedOrders.tga")@@ -185,33 +185,6 @@ def move(rng):return image-def octagon(left, top, right, bottom, cut):- return [(left + cut, top), (right - cut, top), (right, top + cut), (right, bottom - cut),- (right - cut, bottom), (left + cut, bottom), (left, bottom - cut), (left, top + cut)]---def hunt(rng):- image = backdrop(rng, (44, 32, 62), (200, 104, 62), (150, 122, 120), (30, 24, 22), glow=(255, 120, 40))- left, top, right, bottom = W * 0.2, SUPER * 2, W * 0.8, H - SUPER * 5- inset = SUPER * 5- cx, cy = plate(image, octagon(left, top, right, bottom, SUPER * 6), (226, 112, 20),- [(left + inset, top + inset), (right - inset, top + inset),- (left + inset, bottom - inset), (right - inset, bottom - inset)])- # a magnifying glass with a crosshair in its lens- draw = ImageDraw.Draw(image)- white = (248, 246, 240)- scale = (bottom - top) / 125.0- lx, ly, lens = cx - 8 * scale, cy - 8 * scale, 26 * scale- thick = SUPER * 3- draw.ellipse((lx - lens, ly - lens, lx + lens, ly + lens), outline=white, width=thick)- reach = lens * 0.7- for dx, dy in ((1, 0), (-1, 0), (0, 1), (0, -1)):- draw.line((lx + dx * reach * 0.35, ly + dy * reach * 0.35, lx + dx * reach, ly + dy * reach), fill=white, width=SUPER * 2)- along = lens / math.sqrt(2)- draw.line((lx + along, ly + along, lx + along + 26 * scale, ly + along + 26 * scale), fill=white, width=SUPER * 5)- return image--def aggressive(rng):image = backdrop(rng, (80, 34, 30), (196, 84, 44), (130, 104, 96), (34, 24, 20), glow=(255, 140, 40))cx, top, bottom, half = W / 2, SUPER * 2, H - SUPER * 5, W * 0.3@@ -260,7 +233,7 @@ def texture():rng = np.random.default_rng(SEED)sheet = Image.new("RGBA", (TEXTURE_W, TEXTURE_H), (0, 0, 0, 0))# in this order: the stream is shared, so a new cameo goes last and leaves the others as they were- for name, paint in (("attack", attack), ("hold", hold), ("move", move), ("hunt", hunt),+ for name, paint in (("attack", attack), ("hold", hold), ("move", move),("aggressive", aggressive), ("defensive", defensive)):sheet.paste(cameo(paint(rng)).convert("RGBA"), CAMEO_PLACES[name])return sheet@@ -280,13 +253,11 @@ def selfcheck():assert attack_mid[0] > attack_mid[2], attack_midassert hold_mid[2] > hold_mid[0], hold_midassert move_side[1] > move_side[0] and move_side[1] > move_side[2], move_side- # and the three after them: orange, red and steel blue plates+ # and the two stances: red and steel blue platesdef face(x0, y0, x1, y1):return np.asarray(sheet.crop((x0, y0, x1, y1)), dtype=int)[:, :, :3].mean(axis=(0, 1))- hunt_foot = face(128 + 16, 32, 128 + 20, 36)aggressive_foot = face(192 + 27, 34, 192 + 33, 38)defensive_top = face(128 + 16, 64 + 8, 128 + 20, 64 + 14)- assert hunt_foot[0] > 160 and 60 < hunt_foot[1] < 140 and hunt_foot[2] < 60, hunt_footassert aggressive_foot[0] > 140 and aggressive_foot[1] < 60, aggressive_footassert defensive_top[2] > defensive_top[0] + 50, defensive_topassert np.array_equal(np.asarray(texture()), np.asarray(sheet)) # seeded: the same file every time