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(gamelogic): transports unload at a chosen spot, alt unloads in place
Olcay Seygan5856f0d4920e
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 146ebfe9f..3592f382d 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -271,7 +271,7 @@ found and fixed, EA's own, not port damage.**- Allied computer players join the attack a teammate has started, so a team hits one enemy together.- Seven computers against one strong player now count each other. Each used to weigh its own army against all of yours, decide it was outmatched and go on the defensive. When a computer now decides whether to defend, it adds its allies' armies, Hard all of them, Medium three quarters and Easy half, and counts your allies against it the same way. Replays recorded before this change play out differently.- You can call them too. A beacon you place asks your computer allies to attack there, and typing `help`, `attack` or `money` in chat (`yardim`, `saldir`, `para` in Turkish) asks for help where you are looking, an attack there, or cash.-- Or without typing a word. Alt+Z asks your allies to attack the spot under the pointer, Alt+X to come and defend it, Alt+V for money, and Alt+C only marks a spot to look at. The pointer can be on the radar as well. People on your team see the smoke, the radar ping and a line in the chat; computer allies with a personality act on it, in a skirmish against the computer too, where the keys used to do nothing. The keys come from the launcher and move on its Hotkeys page like any other.+- Or without typing a word. Alt+Z asks your allies to attack the spot under the pointer, Alt+X to come and defend it, and Alt+C only marks a spot to look at. The pointer can be on the radar as well. People on your team see the smoke, the radar ping and a line in the chat; computer allies with a personality act on it, in a skirmish against the computer too, where the keys used to do nothing. The keys come from the launcher and move on its Hotkeys page like any other. Request money has no key by default, since Alt+V evacuates a transport; set one on the Hotkeys page, and a key you already gave it stays.- A personality is a preference, never a bonus: every computer earns the same half-again income and the same catch-up bonus, and no personality adds money, faster building or tougher units to it.- Computer players with a personality now and then say something in chat, in their own voice, at most once every two and a half minutes. Normal ones stay quiet.- An Infantry computer player no longer crashes the game while one of its factories researches an upgrade. Shopping for a troop carrier, it read the upgrade in the queue as if it were a vehicle.@@ -566,6 +566,7 @@ found and fixed, EA's own, not port damage.**- A Helix with the gattling cannon on its back lets the cannon do the aiming. The cannon sits on a turret that turns all the way round, yet the whole Helix used to swing round to point at whatever it was shooting. Now it holds its heading and only the turret tracks. With a Crusader driving circles round it, a Helix that used to turn 336 degrees following the tank does not turn at all, and its cannon fired 458 times where it fired 251. Infantry shooting out of a Helix bunker leave the Helix just as free once they are on its target. The Helix's own nose gun only fires forward, so while the cannon has the target it fires only when the target crosses in front.- A helicopter leans into the move. It dips its nose to speed up and lifts it to stop, rolls into a slide sideways and comes level again in a hover, never past about 12 degrees and never with a jerk: the lean moves by at most a degree and a half from one frame to the next.- Helicopters ease in and out of everything they do. Speed builds up over a moment instead of all at once, a stop flares out and settles on the exact spot it was sent to, and a turn winds up to full speed over a third of a second and winds down again before the nose arrives. Sent on a long flight behind itself, a helicopter sets off backwards at once and brings its nose round as it picks up speed; 30 out, the nose is still about 50 degrees off its course, where it used to have finished the whole turn before it got anywhere. Chinooks and Helixes fly the same way as the Comanche, and a gattling Helix keeps its gun on a tank while it slides past. A replay recorded before this change plays back differently.+- Evacuate on any transport vehicle asks where: a Humvee, a Troop Crawler, a Battle Bus, a Technical, a Chinook, a Helix. Click a spot and it drives there, or flies there and lands, and lets everyone out, so a drop behind a ridge is one order where it used to take a move and a second press of the button. A new order on the way calls it off. Hold Alt as you press the button or V and it empties where it stands, as it always did; bunkers and garrisoned buildings still empty on the spot. Combat Drop takes any patch of ground too: with a unit under the cursor the ropes go down on the ground there, where the click used to be refused.## The frame rate cap is gonediff --git a/GeneralsMD/Code/Data/French/Generals.str b/GeneralsMD/Code/Data/French/Generals.strindex b858320e2..5f68ccc06 100644--- a/GeneralsMD/Code/Data/French/Generals.str+++ b/GeneralsMD/Code/Data/French/Generals.str@@ -18492,3 +18492,7 @@ ENDGUI:FactionPickSideNameHint"Cliquez sur le nom d'un camp pour jouer une armée aléatoire de ce camp."END++CONTROLBAR:ToolTipEvacuateAt+"Se rend à l'endroit choisi et ordonne à toutes les unités de sortir.\nAlt : débarquer ici"+ENDdiff --git a/GeneralsMD/Code/Data/INI/CommandSetReforged.ini b/GeneralsMD/Code/Data/INI/CommandSetReforged.iniindex 5d223848e..e2948d9ae 100644--- a/GeneralsMD/Code/Data/INI/CommandSetReforged.ini+++ b/GeneralsMD/Code/Data/INI/CommandSetReforged.ini@@ -43,6 +43,20 @@ CommandButton NonCommand_IdleAircraftDescriptLabel = CONTROLBAR:IdleAircraftDescriptionEnd+; Vehicle transports unload where the player points. No set names this button: EA's own Evacuate+; buttons stay on every bar, and ControlBar::processCommandUI arms this one in their place when the+; selection holds a vehicle transport and Alt is up. The click sends MSG_EVACUATE with the spot, and+; AIGroup::groupEvacuate drives or flies the transport there, lands it if it flies and empties it.+; Alt with the button or its key empties it where it stands, and buildings always do.++CommandButton Command_EvacuateAt+ Command = EVACUATE+ Options = OK_FOR_MULTI_SELECT NEED_TARGET_POS+ DescriptLabel = CONTROLBAR:ToolTipEvacuateAt+ CursorName = Move+ InvalidCursorName = GenericInvalid+End+; ==== China Command Centers after Mines ===========================================================; Buying Mines swaps the Command Center to its Upgrade set, and the Infantry and Nuke copies of thatdiff --git a/GeneralsMD/Code/Data/Patch.str b/GeneralsMD/Code/Data/Patch.strindex fcda1f34d..cb08e8bc6 100644--- a/GeneralsMD/Code/Data/Patch.str+++ b/GeneralsMD/Code/Data/Patch.str@@ -3331,3 +3331,8 @@ ENDGUI:SocketRedirected"The LAN IP is %ls, but the system put the game's connection on %ls. A VPN split tunnel or a firewall redirected it, so nobody on your network can hear you. Turn split tunnelling off for the game and try again."END++// A vehicle transport's Evacuate asks for a spot, the transport goes there and empties; Alt empties it where it stands+CONTROLBAR:ToolTipEvacuateAt+"Go to the chosen spot and order all units to exit\nAlt: unload here"+ENDdiff --git a/GeneralsMD/Code/Data/Russian/Generals.str b/GeneralsMD/Code/Data/Russian/Generals.strindex 6bad3ebcd..9fd6e8afd 100644--- a/GeneralsMD/Code/Data/Russian/Generals.str+++ b/GeneralsMD/Code/Data/Russian/Generals.str@@ -18372,3 +18372,7 @@ ENDGUI:SuperweaponTurkiyeKarguSwarm"Рой Kargu"END++CONTROLBAR:ToolTipEvacuateAt+"Отправиться в выбранную точку и приказать всем юнитам выйти\nAlt: высадить здесь"+ENDdiff --git a/GeneralsMD/Code/Data/Turkish/Generals.str b/GeneralsMD/Code/Data/Turkish/Generals.strindex e6650ea81..42b1f33a2 100644--- a/GeneralsMD/Code/Data/Turkish/Generals.str+++ b/GeneralsMD/Code/Data/Turkish/Generals.str@@ -17671,3 +17671,7 @@ ENDGUI:SocketRedirected"LAN IP adresi %ls, ama sistem oyunun bağlantısını %ls üzerine koydu. Bir VPN'in bölünmüş tüneli (split tunnel) ya da bir güvenlik duvarı bağlantıyı yönlendirdi, bu yüzden ağınızdaki kimse sizi duyamıyor. Oyun için bölünmüş tüneli kapatıp yeniden deneyin."END++CONTROLBAR:ToolTipEvacuateAt+"Seçtiğiniz yere gidip tüm birliklere çıkma emri verin\nAlt: burada indir"+ENDdiff --git a/GeneralsMD/Code/Data/Ukrainian/Generals.str b/GeneralsMD/Code/Data/Ukrainian/Generals.strindex 470064169..d8bdfaae9 100644--- a/GeneralsMD/Code/Data/Ukrainian/Generals.str+++ b/GeneralsMD/Code/Data/Ukrainian/Generals.str@@ -18372,3 +18372,7 @@ ENDGUI:SuperweaponTurkiyeKarguSwarm"Рій Kargu"END++CONTROLBAR:ToolTipEvacuateAt+"Вирушити у вибрану точку й наказати всім підрозділам вийти\nAlt: висадити тут"+ENDdiff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/AI.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/AI.hindex 3b13a43ba..b8eb7a330 100644--- a/GeneralsMD/Code/GameEngine/Include/GameLogic/AI.h+++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/AI.h@@ -1817,7 +1817,8 @@ public:void groupEnter( Object *obj, CommandSourceType cmdSource ); ///< enter the given objectvoid groupDock( Object *obj, CommandSourceType cmdSource ); ///< get near given object and wait for enter clearancevoid groupExit( Object *objectToExit, CommandSourceType cmdSource ); ///< get out of this Object- void groupEvacuate( CommandSourceType cmdSource ); ///< empty its contents+ void groupEvacuate( CommandSourceType cmdSource, const Coord3D *at = NULL ); ///< empty its contents; vehicle transports go to at first+ static Bool unloadsWhereSent( const Object *obj ); ///< a vehicle transport: Evacuate asks for a spotvoid groupExecuteRailedTransport( CommandSourceType cmdSource ); ///< execute railed transport eventsvoid groupGoProne( const DamageInfo *damageInfo, CommandSourceType cmdSource ); ///< life altering state change, if this AI can do itvoid groupGuardPosition( const Coord3D *pos, GuardMode guardMode, CommandSourceType cmdSource ); ///< guard the given spotdiff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cppindex a400e46c4..3b382317e 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp@@ -54,6 +54,7 @@#include "GameClient/Keyboard.h"#include "GameClient/AnimateWindowManager.h"+#include "GameLogic/AI.h"#include "GameLogic/GameLogic.h"#include "GameLogic/Object.h"#include "GameLogic/Module/ProductionUpdate.h"@@ -993,14 +994,28 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control,//---------------------------------------------------------------------------------------------case GUI_COMMAND_EVACUATE:{+ // A vehicle transport asks where: Command_EvacuateAt's cursor takes the spot, and the+ // transport drives or flies there and unloads (AIGroup::groupEvacuate). Alt held, here or+ // with the button's key (HotKeyTranslator), empties it where it stands, as a building does+ const CommandButton *evacuateAt = TheKeyboard->isAlt() ? NULL : findCommandButton( "Command_EvacuateAt" );+ if( evacuateAt )+ {+ const DrawableList *selected = TheInGameUI->getAllSelectedDrawables();+ for( DrawableListCIt it = selected->begin(); it != selected->end(); ++it )+ {+ const Object *transport = (*it)->getObject();+ if( transport && AIGroup::unloadsWhereSent( transport ) )+ {+ TheInGameUI->setGUICommand( evacuateAt );+ return CBC_COMMAND_USED;+ }+ }+ }+// Cancel GUI command mode.TheInGameUI->setGUICommand( NULL );-- if (BitTest(commandButton->getOptions(), NEED_TARGET_POS) == FALSE) {- pickAndPlayUnitVoiceResponse( TheInGameUI->getAllSelectedDrawables(), GameMessage::MSG_EVACUATE );- TheMessageStream->appendMessage( GameMessage::MSG_EVACUATE );- }-+ pickAndPlayUnitVoiceResponse( TheInGameUI->getAllSelectedDrawables(), GameMessage::MSG_EVACUATE );+ TheMessageStream->appendMessage( GameMessage::MSG_EVACUATE );break;} // end evacuatediff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cppindex 3f368a9f4..0ee9c275d 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp@@ -91,6 +91,7 @@#include "GameClient/MetaEvent.h"#include "GameClient/ControlBar.h"#include "GameClient/DisplayStringManager.h"+#include "GameLogic/AI.h"#include "GameLogic/GameLogic.h"#include "GameLogic/Damage.h"#include "GameLogic/Module/FireWeaponWhenDeadBehavior.h"@@ -786,6 +787,11 @@ void ControlBar::populateBuildTooltipLayout( const CommandButton *commandButton,Object *selectedObject = draw ? draw->getObject() : NULL;if( selectedObject ){+ // a vehicle transport's Evacuate asks where, and Alt empties it on the spot+ // (ControlBar::processCommandUI); buildings keep EA's text+ if( commandButton->getCommandType() == GUI_COMMAND_EVACUATE && AIGroup::unloadsWhereSent( selectedObject ) )+ descrip = TheGameText->fetch( "CONTROLBAR:ToolTipEvacuateAt" );+//Special case: Append status of overcharge on China power plant.if( commandButton->getCommandType() == GUI_COMMAND_TOGGLE_OVERCHARGE ){diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cppindex dd6b16d55..5df74f9bf 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp@@ -1890,6 +1890,15 @@ GameMessage::Type CommandTranslator::evaluateContextCommand( Drawable *draw,}}+ // Combat Drop ropes down onto any ground: a unit, or a building nobody can rope into, under+ // the cursor leaves the drop on the ground there instead of refusing the click+ if( obj && command->getCommandType() == GUI_COMMAND_COMBATDROP && BitTest( command->getOptions(), NEED_TARGET_POS )+ && !TheInGameUI->canSelectedObjectsDoAction( InGameUI::ACTIONTYPE_COMBATDROP_INTO, obj, InGameUI::SELECTION_ANY ) )+ {+ draw = NULL;+ obj = NULL;+ }+Bool currentlyValid = FALSE;ObjectID objectID = obj ? obj->getID() : INVALID_ID;switch( command->getCommandType() )diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HotKey.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HotKey.cppindex 15879fcef..55772a287 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HotKey.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/HotKey.cpp@@ -66,6 +66,7 @@#include "Common/GlobalData.h"#include "Common/INI.h"#include "Common/ThingTemplate.h"+#include "GameClient/CommandXlat.h"#include "GameClient/ControlBar.h"#include "GameClient/Drawable.h"#include "GameClient/GadgetPushButton.h"@@ -137,10 +138,21 @@ Bool HotKeyManager::strokePressesBar( Int key )return !command;}+// Alt and the Evacuate button's key empty a transport where it stands instead of asking where+// (ControlBar::processCommandUI), so that chord is the bar's+static Bool isEvacuateButton( GameWindow *win )+{+ const CommandButton *command = win ? (const CommandButton *)GadgetButtonGetData( win ) : NULL;+ return command && command->getCommandType() == GUI_COMMAND_EVACUATE;+}+Bool HotKeyManager::barHoldsKey( Int key, Int modState ){- // the release presses a button bare or with shift (a batch); a chord with Ctrl or Alt is the command's- if( TheHotKeyManager == NULL || TheKeyboard == NULL || key < 0 || key >= STROKE_KEYS || ( modState & ~SHIFT ) != 0 )+ // the release presses a button bare or with shift (a batch); a chord with Ctrl or Alt is the+ // command's, but for Alt with the Evacuate button's key+ const Bool alt = modState == ALT;+ if( TheHotKeyManager == NULL || TheKeyboard == NULL || key < 0 || key >= STROKE_KEYS ||+ ( ( modState & ~SHIFT ) != 0 && !alt ) )return FALSE;if( TheShell && TheShell->isShellActive() )return FALSE; // the menus have no command bar, whatever the map still names@@ -149,7 +161,7 @@ Bool HotKeyManager::barHoldsKey( Int key, Int modState )return FALSE;Bool pressable = FALSE;GameWindow *win = TheHotKeyManager->findHotKey( nameOf( letter ), &pressable );- return win != NULL && !BitTest( win->winGetStatus(), WIN_STATUS_HIDDEN );+ return win != NULL && !BitTest( win->winGetStatus(), WIN_STATUS_HIDDEN ) && ( !alt || isEvacuateButton( win ) );}Bool HotKeyManager::commandMapHolds( const AsciiString& key )@@ -174,6 +186,7 @@ GameMessageDisposition HotKeyTranslator::translateGameMessage(const GameMessageif ( t == GameMessage::MSG_RAW_KEY_UP){// a press the command map took presses no button on its release, whatever the bar shows now+ const Bool barHeld = HotKeyManager::strokeToBar( msg->getArgument(0)->integer );if( !HotKeyManager::strokePressesBar( msg->getArgument(0)->integer ) )return disp;@@ -198,6 +211,25 @@ GameMessageDisposition HotKeyTranslator::translateGameMessage(const GameMessage{newModState |= ALT;}+ // Alt and the Evacuate button's key (barHoldsKey), whichever was let go first: the transport+ // empties where it stands, as an Alt-click on the button does (ControlBar::processCommandUI)+ if( barHeld && ( keyState & ( KEY_STATE_ALT | KEY_STATE_PRESSED_WITH_CTRL_ALT ) ) && !( keyState & KEY_STATE_CONTROL ) )+ {+ Bool pressable = FALSE;+ GameWindow *win = TheHotKeyManager ? TheHotKeyManager->findHotKey(+ HotKeyManager::nameOf( typedLetter( (UnsignedByte)msg->getArgument(0)->integer ) ), &pressable ) : NULL;+ if( pressable && isEvacuateButton( win ) )+ {+ TheInGameUI->setGUICommand( NULL );+ pickAndPlayUnitVoiceResponse( TheInGameUI->getAllSelectedDrawables(), GameMessage::MSG_EVACUATE );+ TheMessageStream->appendMessage( GameMessage::MSG_EVACUATE );+ AudioEventRTS buttonClick( "GUIClick" );+ if( TheAudio )+ TheAudio->addAudioEvent( &buttonClick );+ return DESTROY_MESSAGE;+ }+ }+// Ctrl+Alt and a build button's key puts its unit on repeat or takes it offconst Bool repeatChord = newModState == ( CTRL | ALT );// shift is allowed through: a shift-click on a build button queues a batch of units, and@@ -982,11 +1014,11 @@ std::vector< HotkeyCommandRow > Hotkeys_commandRows( const std::string& commandMsnprintf( name, sizeof( name ), "COMMAND_SLOT%02d", slot );unbound.push_back( commandRow( name, "GRID" ) );}- // LAUNCHER_DEFAULTS: I, free in the shipped map, for the next idle worker, and Alt with Z, X, C- // and V, which nothing in the shipped map holds, for the requests to the allies+ // LAUNCHER_DEFAULTS: I, free in the shipped map, for the next idle worker, and Alt with Z, X and C,+ // which nothing in the shipped map holds, for the signals to the allies. Request money has no key:+ // Alt+V is evacuate in place.static const char *const DEFAULTS[][ 3 ] = { { "SELECT_NEXT_IDLE_WORKER", "KEY_I", "NONE" },- { "SIGNAL_ATTACK", "KEY_Z", "ALT" }, { "SIGNAL_DEFEND", "KEY_X", "ALT" }, { "SIGNAL_ATTENTION", "KEY_C", "ALT" },- { "REQUEST_MONEY", "KEY_V", "ALT" } };+ { "SIGNAL_ATTACK", "KEY_Z", "ALT" }, { "SIGNAL_DEFEND", "KEY_X", "ALT" }, { "SIGNAL_ATTENTION", "KEY_C", "ALT" } };for( size_t each = 0; each < unbound.size(); each++ )for( size_t row = 0; row < sizeof( DEFAULTS ) / sizeof( DEFAULTS[ 0 ] ); row++ )if( unbound[ each ].id == DEFAULTS[ row ][ 0 ] )diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cppindex 0db3176da..3b635e8da 100644--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp@@ -3345,9 +3345,23 @@ void AIGroup::groupExit( Object *objectToExit, CommandSourceType cmdSource )}/**- * Empty its contents+ * A vehicle transport, on the ground or in the air: its Evacuate asks for a spot (ControlBar::+ * processCommandUI). Buildings, bunkers and garrisons are no VEHICLE, the Overlord's bunker is no+ * TRANSPORT and the railed ferry, which takes no move from a player, is no VEHICLE. One that cannot+ * move now (a Battle Bus gone bunker, a Chinook on its ropes, an EMP) empties where it stands, since+ * privateMoveToAndEvacuate would drop the order.*/-void AIGroup::groupEvacuate( CommandSourceType cmdSource )+Bool AIGroup::unloadsWhereSent( const Object *obj )+{+ return obj->isKindOf( KINDOF_VEHICLE ) && obj->isKindOf( KINDOF_TRANSPORT ) && obj->getContain() != NULL+ && obj->isMobile();+}++/**+ * Empty its contents. With at, the spot the Evacuate button was pointed at: a vehicle transport+ * drives or flies there, lands if it flies, and unloads; everything else empties where it stands.+ */+void AIGroup::groupEvacuate( CommandSourceType cmdSource, const Coord3D *at ){std::list<Object *>::iterator i;for( i = m_memberList.begin(); i != m_memberList.end(); ++i )@@ -3355,10 +3369,11 @@ void AIGroup::groupEvacuate( CommandSourceType cmdSource )AIUpdateInterface *ai = (*i)->getAIUpdateInterface();if (ai){- if( (*i)->isKindOf( KINDOF_AIRCRAFT ) && (*i)->isAirborneTarget() )+ const Bool goThere = at && unloadsWhereSent( *i );+ if( goThere || ( (*i)->isKindOf( KINDOF_AIRCRAFT ) && (*i)->isAirborneTarget() ) ){//Calculate the highest point on the ground to drop off troops (chinook or other air transports)- Coord3D pos = *((*i)->getPosition());+ Coord3D pos = goThere ? *at : *((*i)->getPosition());PathfindLayerEnum layerAtDest = TheTerrainLogic->getHighestLayerForDestination( &pos );pos.z = TheTerrainLogic->getLayerHeight( pos.x, pos.y, layerAtDest );ai->aiMoveToAndEvacuate( &pos, cmdSource );diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cppindex eebe4f16a..b2c1cd2ed 100644--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp@@ -3554,7 +3554,10 @@ StateReturnType AIMoveAndEvacuateState::onEnter(){Object *obj = getMachineOwner();- getMachine()->lock("AIMoveAndEvacuateState::onEnter"); // This state is not user interruptable.+ // A script's or the AI's drop is not user interruptable. A player's is: a transport sent to+ // unload across the map takes a new order on the way, as a move would.+ if( obj->getAI()->getLastCommandSource() != CMD_FROM_PLAYER )+ getMachine()->lock("AIMoveAndEvacuateState::onEnter");m_origin = *obj->getPosition();setAdjustsDestination(true);diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cppindex f03219424..b4873daac 100644--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/ChinookAIUpdate.cpp@@ -1362,8 +1362,9 @@ void ChinookAIUpdate::aiDoCommand(const AICommandParms* parms)// the evac state below unloads the whole hold in one frame. Only take it when the// container has somebody queued to get in or out; otherwise let the standard move// command through, which unloads one passenger at a time. Never for the _AND_EXIT form a- // script reinforcement uses: the standard state asks to land while it is locked, is refused,- // and flies the Chinook home to be deleted with everyone still aboard.+ // script reinforcement uses: the standard state, locked for a script's or the AI's order+ // (AIMoveAndEvacuateState::onEnter), asks to land, is refused, and flies the Chinook home+ // to be deleted with everyone still aboard. A player's drop is not locked.const ContainModuleInterface* contain = getObject()->getContain();const Bool allowExit = parms->m_cmd == AICMD_MOVE_TO_POSITION_AND_EVACUATE_AND_EXIT ||(contain && contain->hasObjectsWantingToEnterOrExit());diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cppindex e45e1bcef..a841e2ab7 100644--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp@@ -1600,20 +1600,14 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, AIGroup *orderedGroup// AIGroup *group = TheAI->findGroup( *selectedGroupID );if( currentlySelectedGroup ){- //Coord3D pos;- //Bool hasArgs = FALSE;- //hasArgs = (msg->getArgumentCount() > 0);-- //if (hasArgs)- // pos = msg->getArgument(0)->location;-currentlySelectedGroup->releaseWeaponLockForGroup(LOCKED_TEMPORARILY); // release any temporary locks.- // evacuate message is for the selected group- //if (hasArgs)- // currentlySelectedGroup->groupMoveToAndEvacuate( &pos, CMD_FROM_PLAYER );- //else- currentlySelectedGroup->groupEvacuate( CMD_FROM_PLAYER );+ // evacuate message is for the selected group. A location is where a vehicle transport's+ // Evacuate was pointed: those drive or fly there and unload, the rest empty where they stand+ const Bool hasSpot = msg->getArgumentCount() > 0+ && msg->getArgumentDataType( 0 ) == ARGUMENTDATATYPE_LOCATION;+ const Coord3D *at = hasSpot ? &msg->getArgument( 0 )->location : NULL;+ currentlySelectedGroup->groupEvacuate( CMD_FROM_PLAYER, at );// no, this is bad, don't do here, do when POSTING message// pickAndPlayUnitVoiceResponse( TheInGameUI->getAllSelectedDrawables(), GameMessage::MSG_EVACUATE );diff --git a/GeneralsMD/Code/Tests/test_gameengine.cpp b/GeneralsMD/Code/Tests/test_gameengine.cppindex 9387f06c3..5418fe20d 100644--- a/GeneralsMD/Code/Tests/test_gameengine.cpp+++ b/GeneralsMD/Code/Tests/test_gameengine.cpp@@ -2141,9 +2141,9 @@ TEST(hotkeys_file_reads_the_launchers_rows_and_leaves_its_defaults_out)// KEY_NONE is not a key the launcher shows, so the shipped hold comes back as its own bar-only rowCHECK( hold != NULL && hold->barOnly && hold->binding == HotkeyBinding( "", "CTRL" ) && hold->pair == "END_FORCEATTACK" );CHECK( idle != NULL && idle->launcherDefault && idle->binding.key == "KEY_I" );- // the requests to the allies start on Alt and Z, X, C and V, as the launcher writes them (issue 129)+ // the signals to the allies start on Alt and Z, X and C, as the launcher writes them (issue 129)static const char *const ASKS[][ 2 ] = { { "SIGNAL_ATTACK", "KEY_Z" }, { "SIGNAL_DEFEND", "KEY_X" },- { "SIGNAL_ATTENTION", "KEY_C" }, { "REQUEST_MONEY", "KEY_V" } };+ { "SIGNAL_ATTENTION", "KEY_C" } };for( size_t ask = 0; ask < sizeof( ASKS ) / sizeof( ASKS[ 0 ] ); ask++ ){Bool found = FALSE;@@ -2152,6 +2152,12 @@ TEST(hotkeys_file_reads_the_launchers_rows_and_leaves_its_defaults_out)&& rows[ each ].binding == HotkeyBinding( ASKS[ ask ][ 1 ], "ALT" ) && rows[ each ].category == "INFORMATION" );CHECK( found );}+ // request money has no key: Alt+V is evacuate in place+ Bool money = FALSE;+ for( size_t each = 0; each < rows.size(); each++ )+ money = money || ( rows[ each ].id == "REQUEST_MONEY" && !rows[ each ].launcherDefault+ && rows[ each ].binding == HotkeyBinding() && rows[ each ].category == "INFORMATION" );+ CHECK( money );// the launcher's own defaults in the player's part are no change of hisconst HotkeysFile mine = Hotkeys_parse(