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.

feat(gameengine): build with nothing selected, an idle builder goes

Olcay Seygan46c6520bc857
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 08e0ee445..617acf90c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -678,7 +678,7 @@ A third pass went through the generals' powers, promotions and unit abilities.
- Hold shift and drag, and the row is one stroke. Press where the first building goes, drag the way the row runs, and a ghost appears for every building that fits end to end along the line, all facing the way the first one was turned. The row runs exactly the way you drag it, at 20 degrees as happily as along the map's edge, and packs the buildings as close as their shape allows: one turned onto the line of the row stands wall to wall with the next, and a factory keeps its door lane clear. A row of Power Plants turned square to the map packs 44 apart; it used to go down on whole grid squares, 50 apart, with a strip of dirt at every joint. It stops at the last building your bank can pay for. A ghost that lands on a rock or someone's tank turns red and is left out when you let go; the rest go up. With two or three workers selected the buildings are shared out to the nearest free one, and the ones nobody is free for wait as plans until a worker comes off its job. A plain drag still turns the building, and walls still tile the way they always did.
- While that row is on the cursor, the wheel opens and closes the space between the buildings, one grid square a notch. The one where you pressed and the one under the cursor stay put; what changes is how many stand between them and how far apart those are. It will not pack them any tighter than they already sit against each other, and it will not take either end away to make the gap. Letting go places the row and takes the building off the cursor, so the next click is not another one. Holding shift and clicking them out one at a time still keeps the ghost up.
- Hold Alt and drag while placing a building, and you lay out a block of them instead of a row. Ghosts stand for as many as your money covers, a blocked spot is skipped, and your builders work through the block in order.
-- Buildings need a worker selected. With nothing selected the command bar used to borrow one of your dozers and offer its buildings anyway. It stays empty now until you pick a worker, and a replay recorded with a building placed that way plays back without it.
+- With nothing selected the command bar shows your builders' buildings again. Put one down and the idle worker nearest the spot walks over and builds it; when every worker is busy, the nearest one takes it on after the job in hand. A shift-dragged row placed this way is shared out among your idle workers. The bar keeps showing the same worker while you place, so a GLA worker switched to fake buildings stays on that page, and a fake is only ever handed to a worker who is on it. That last part holds with workers selected too: select a real-page and a fake-page worker together and a building goes to the one that can build it, where it used to go to the nearest and be refused. A replay with such a mixed selection in it plays back differently.
- Turning a building no longer turns everything you build afterwards. A wheeled heading still carries from one wall to the next, but the next supply centre comes out facing the way it was designed to.
- A building you point at blocked ground slides to the nearest spot it fits, and lands there.
- The pointer keeps its build cursor while you place, even passing over your own buildings.
diff --git a/GeneralsMD/Code/Data/Scenarios/standinbuild.txt b/GeneralsMD/Code/Data/Scenarios/standinbuild.txt
new file mode 100644
index 000000000..aa1c32446
--- /dev/null
+++ b/GeneralsMD/Code/Data/Scenarios/standinbuild.txt
@@ -0,0 +1,22 @@
+# Buildings placed with nothing selected: the command bar's stand-in builder.
+#
+# construct is the placement click itself, a message on the stream that the replay records, so the
+# logic picks the builder the way it does for a player: with nothing selected, the idle builder
+# nearest the site, and once none is idle the nearest busy one, who takes it after the job in hand.
+# Slot 0 is the local seat, so no -observer. One dozer, three power plants: the tally at the end
+# reads 3 alive and $7600. Before the stand-in came back it read 0 and $10000.
+#
+# Nothing here is a world command that bypasses the replay (no spawn), so the replay this run
+# leaves plays back to the same HEADLESS CRC with -replay and no -scenario.
+#
+# generals.exe -headless -quickstart -noshellmap -multiInstance -noFPSLimit
+# -randommap 1 2 small -autoskirmish 2 -takeover
+# -side 0 FactionAmerica -side 1 FactionGLA -seed 1 -maxframes 1800
+# -scenario standinbuild -logPrefix standin_
+#
+# The sites are the open sand in the middle of this map (docs/reference/UI-MAP.md, 700,550).
+
+120 construct 0 AmericaPowerPlant 720 550
+120 construct 0 AmericaPowerPlant 620 650
+120 construct 0 AmericaPowerPlant 520 650
+1790 tally 0 AmericaPowerPlant
diff --git a/GeneralsMD/Code/Data/Scenarios/standinfake.txt b/GeneralsMD/Code/Data/Scenarios/standinfake.txt
new file mode 100644
index 000000000..359888361
--- /dev/null
+++ b/GeneralsMD/Code/Data/Scenarios/standinfake.txt
@@ -0,0 +1,17 @@
+# A GLA base placed with nothing selected, every worker on its fake-structure page.
+#
+# The logic hands a placement to a builder whose own command set has the structure, so the fake
+# supply stash goes up and the real barracks finds nobody to build it and costs nothing. The
+# tallies at the end read 1 and 0, and the money 9625. See standinbuild.txt for what construct is.
+# shiftupgrade goes straight to the logic and not through the replay, so this one does not play back.
+#
+# generals.exe -headless -quickstart -noshellmap -multiInstance -noFPSLimit
+# -randommap 1 2 small -autoskirmish 2 -takeover
+# -side 0 FactionGLA -side 1 FactionAmerica -seed 1 -maxframes 1800
+# -scenario standinfake -logPrefix standinfake_
+
+60 shiftupgrade 0 GLAInfantryWorker Upgrade_GLAWorkerFakeCommandSet
+240 construct 0 FakeGLASupplyStash 720 550
+250 construct 0 GLABarracks 620 650
+1790 tally 0 FakeGLASupplyStash
+1790 tally 0 GLABarracks
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h
index 622e50792..78a5f71a2 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/ControlBar.h
@@ -1268,6 +1268,8 @@ public:
// get method for list of commandbuttons
const CommandButton *getCommandButtons( void ) { return m_commandButtons; }
+ Drawable *findStandInBuilder( Bool freeOnly ); ///< the local player's free builder (or, unless freeOnly, any builder) to stand in for an empty selection
+
protected:
ICoord2D m_defaultControlBarPosition; ///< Stored the original position of the control bar on the screen
@@ -1365,6 +1367,7 @@ protected:
CommandButton *m_buildPageBackButton; ///< takes a page back to the menu buttons
Int m_buildPage; ///< BUILD_PAGE_ROOT, or the page being shown
ObjectID m_buildPageObjectID; ///< builder the page belongs to; a new one starts at the menu
+ DrawableID m_standInBuilderID; ///< with nothing selected, the builder whose command bar is shown (INVALID_DRAWABLE_ID otherwise)
/** A player upgrade is researched once, so it goes to exactly one of the selected buildings -
* and the bar cannot see the queue an earlier click in this same frame just filled, because
diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/ScenarioDrill.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/ScenarioDrill.h
index b7ad9553f..74c9f1068 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameLogic/ScenarioDrill.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/ScenarioDrill.h
@@ -81,7 +81,8 @@ enum ScenarioActionType
SCENARIO_ACTION_SHIFTGUARD, ///< shiftguard <slot> <selector> <position>; the same with the guard key
SCENARIO_ACTION_SHIFTPOWER, ///< shiftpower <slot> <selector> <targetSlot> <targetSelector> <power>; the same with a special power armed, on one object
SCENARIO_ACTION_SHIFTUPGRADE, ///< shiftupgrade <slot> <selector> <upgrade>; shift on an object upgrade button, bought by every unit that matches
- SCENARIO_ACTION_DOCK ///< dock <slot> <selector> <targetSlot> <targetSelector>; a right click on a supply point or a dock
+ SCENARIO_ACTION_DOCK, ///< dock <slot> <selector> <targetSlot> <targetSelector>; a right click on a supply point or a dock
+ SCENARIO_ACTION_CONSTRUCT ///< construct <slot> <template> <position>; the local player's placement click, whatever is selected, as a message that is recorded and crosses the network
};
/// ScenarioAction::atStart when the position is plain numbers
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
index fcf7de572..33257835d 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp
@@ -1385,6 +1385,7 @@ ControlBar::ControlBar( void )
m_multiSelectFocus = 0;
m_buildPage = BUILD_PAGE_ROOT;
m_buildPageObjectID = INVALID_ID;
+ m_standInBuilderID = INVALID_DRAWABLE_ID;
m_rallyPointDrawableID = INVALID_DRAWABLE_ID;
m_displayedConstructPercent = -1.0f;
m_displayedOCLTimerSeconds = 0;
@@ -3031,6 +3032,7 @@ void ControlBar::reset( void )
m_buildPage = BUILD_PAGE_ROOT;
m_buildPageObjectID = INVALID_ID;
+ m_standInBuilderID = INVALID_DRAWABLE_ID;
m_isObserverCommandBar = FALSE; // reset us to use a normal command bar
m_observerLookAtPlayer = NULL;
@@ -3298,6 +3300,31 @@ void ControlBar::update( void )
else
clearPurchaseScienceColumn();
+ //
+ // a stand-in builder is not selected, so no deselect event tells us when it dies or when a
+ // real selection arrives; re-evaluate ourselves before anything touches its drawable
+ //
+ if( m_standInBuilderID != INVALID_DRAWABLE_ID )
+ {
+ Drawable *standIn = TheGameClient->findDrawableByID( m_standInBuilderID );
+ Object *standInObj = standIn ? standIn->getObject() : NULL;
+ if( TheInGameUI->getSelectCount() > 0 || standInObj == NULL || standInObj->isEffectivelyDead() )
+ {
+ m_standInBuilderID = INVALID_DRAWABLE_ID;
+ m_currentSelectedDrawable = NULL;
+ markUIDirty();
+ }
+ }
+ //
+ // nothing selected and nothing standing in: a builder that is made or bought later gets the
+ // bar, which no selection event would announce either
+ //
+ else if( logicTick && ( logicNow % LOGICFRAMES_PER_SECOND ) == 0 && TheInGameUI->getSelectCount() == 0
+ && m_currentSelectedDrawable == NULL && findStandInBuilder( FALSE ) )
+ {
+ markUIDirty();
+ }
+
//
// first, if the UI is dirty repopulate the UI with what the user should see for all the
// selected drawables
@@ -3562,6 +3589,23 @@ void ControlBar::evaluateContextUI( void )
// erase any current state of the GUI by switching out to the empty context
switchToContext( CB_CONTEXT_NONE, NULL );
+ //
+ // nothing selected: one of the player's builders stands in and its command bar shows, so
+ // a structure can be placed without selecting a dozer first - the logic then sends the
+ // idle builder nearest the site (MSG_DOZER_CONSTRUCT). m_standInBuilderID is not cleared
+ // first: findStandInBuilder reads it to keep the builder it is already showing.
+ //
+ if( TheInGameUI->getSelectCount() == 0 && !m_isObserverCommandBar )
+ {
+ Drawable *builder = findStandInBuilder( FALSE );
+ m_standInBuilderID = builder ? builder->getID() : INVALID_DRAWABLE_ID;
+ if( builder )
+ switchToContext( CB_CONTEXT_COMMAND, builder );
+ return;
+ }
+
+ m_standInBuilderID = INVALID_DRAWABLE_ID;
+
// get the list of drawable IDs from the in game UI
const DrawableList *selectedDrawables = TheInGameUI->getAllSelectedDrawables();
@@ -4086,6 +4130,74 @@ Bool ControlBar::cancelLastQueuedUnit( const ThingTemplate *thing )
} // end cancelLastQueuedUnit
+//-------------------------------------------------------------------------------------------------
+/** The local player's builder that stands in for an empty selection: an idle one if there is
+ * one, else any live one. (Player::iterateObjects callback + driver.) */
+//-------------------------------------------------------------------------------------------------
+struct StandInBuilderSearch
+{
+ Object *idle;
+ Object *any;
+};
+
+static void findStandInBuilderProc( Object *obj, void *userData )
+{
+ StandInBuilderSearch *s = (StandInBuilderSearch *)userData;
+ if( obj == NULL || obj->isEffectivelyDead() || obj->getDrawable() == NULL )
+ return;
+ if( obj->testStatus( OBJECT_STATUS_UNDER_CONSTRUCTION ) || obj->testStatus( OBJECT_STATUS_SOLD ) )
+ return;
+ AIUpdateInterface *ai = obj->getAI();
+ DozerAIInterface *dozer = ai ? ai->getDozerAIInterface() : NULL;
+ if( dozer == NULL )
+ return;
+ if( s->any == NULL )
+ s->any = obj;
+ // free = no build/repair task and not hauling supplies; walking somewhere does not count
+ const SupplyTruckAIInterface *supply = ai->getSupplyTruckAIInterface();
+ if( s->idle == NULL && !dozer->isAnyTaskPending() && !( supply && supply->isCurrentlyFerryingSupplies() ) )
+ s->idle = obj;
+}
+
+Drawable *ControlBar::findStandInBuilder( Bool freeOnly )
+{
+ Player *player = ThePlayerList ? ThePlayerList->getLocalPlayer() : NULL;
+ if( player == NULL )
+ return NULL;
+
+ //
+ // The builder already standing in keeps the bar for as long as it is still a builder. The
+ // sweep below answers "the first idle one", and idleness changes on its own: a dozer somewhere
+ // across the base finishing a building goes idle and used to take the bar off the one you were
+ // working with. That drops the page you were on and takes the structure off your cursor, in
+ // the middle of placing it, because something happened somewhere else. For a GLA worker it
+ // also keeps the fake-structure page it was switched to.
+ //
+ if( m_standInBuilderID != INVALID_DRAWABLE_ID && TheGameClient )
+ {
+ Drawable *held = TheGameClient->findDrawableByID( m_standInBuilderID );
+ Object *obj = held ? held->getObject() : NULL;
+ if( obj && obj->getControllingPlayer() == player )
+ {
+ StandInBuilderSearch check;
+ check.idle = NULL;
+ check.any = NULL;
+ findStandInBuilderProc( obj, &check );
+ if( check.any && ( !freeOnly || check.idle ) )
+ return held;
+ }
+ }
+
+ StandInBuilderSearch s;
+ s.idle = NULL;
+ s.any = NULL;
+ player->iterateObjects( findStandInBuilderProc, &s );
+
+ Object *pick = s.idle ? s.idle : ( freeOnly ? NULL : s.any );
+ return pick ? pick->getDrawable() : NULL;
+
+} // end findStandInBuilder
+
//-------------------------------------------------------------------------------------------------
/** Press the index'th general's power shortcut button, as a mouse click would */
//-------------------------------------------------------------------------------------------------
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/PlaceEventTranslator.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/PlaceEventTranslator.cpp
index 706bd3e37..f9659c74b 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/PlaceEventTranslator.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/PlaceEventTranslator.cpp
@@ -89,7 +89,12 @@ static Bool getPlacementDrag( ICoord2D *start, ICoord2D *end )
} // end getPlacementDrag
//-------------------------------------------------------------------------------------------------
-/** The object that is to do the building: the one the placement was started from, while it lives. */
+/** The object that is to do the building. Normally the one the placement was started from, but
+ * with nothing selected the command bar is being driven by a stand-in builder that is not part of
+ * any selection - and that one is free to die between two clicks of a shift-held run of
+ * structures. When it is gone, ask the command bar for the current stand-in rather than dropping
+ * out of placement mode: the logic picks the idle builder nearest the site anyway
+ * (MSG_DOZER_CONSTRUCT), so any builder will do to keep the ghost on the cursor. */
//-------------------------------------------------------------------------------------------------
static Object *resolvePlacementBuilder( void )
{
@@ -97,7 +102,8 @@ static Object *resolvePlacementBuilder( void )
if( builder != NULL && !builder->isEffectivelyDead() )
return builder;
- return NULL;
+ Drawable *standIn = TheControlBar ? TheControlBar->findStandInBuilder( FALSE ) : NULL;
+ return standIn ? standIn->getObject() : NULL;
}
//-------------------------------------------------------------------------------------------------
diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp
index 418b97abc..c02870dec 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogicDispatch.cpp
@@ -68,10 +68,15 @@
//-------------------------------------------------------------------------------------------------
/** Which builder takes a structure job: the free one nearest the site, or failing that the
* nearest one at all. Free = no build/repair task and not hauling supplies; a builder that
- * is merely walking somewhere counts. Fed from the selection. */
+ * is merely walking somewhere counts. Fed from the selection, or from every builder of the
+ * player when no builder is selected (the control bar's stand-in builder context). Only a
+ * builder whose command set has the structure counts: a GLA worker switched to its fake
+ * structures builds those and the real ones only from the other page, and a captured dozer
+ * builds its own side's. */
//-------------------------------------------------------------------------------------------------
struct BuilderPick
{
+ const ThingTemplate *place;
Coord3D loc;
Object *idle;
Real idleDistSqr;
@@ -89,6 +94,8 @@ static void considerBuilder( Object *candidate, BuilderPick *pick )
DozerAIInterface *dozer = ai ? ai->getDozerAIInterface() : NULL;
if( dozer == NULL )
return;
+ if( !TheBuildAssistant->isPossibleToMakeUnit( candidate, pick->place ) )
+ return;
Real dx = candidate->getPosition()->x - pick->loc.x;
Real dy = candidate->getPosition()->y - pick->loc.y;
@@ -106,6 +113,11 @@ static void considerBuilder( Object *candidate, BuilderPick *pick )
pick->idleDistSqr = distSqr;
}
}
+
+static void considerBuilderProc( Object *obj, void *userData )
+{
+ considerBuilder( obj, (BuilderPick *)userData );
+}
#include "GameLogic/Module/BodyModule.h"
#include "GameLogic/Module/OpenContain.h"
#include "GameLogic/Module/ProductionUpdate.h"
@@ -1833,11 +1845,12 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, AIGroup *orderedGroup
angle = msg->getArgument( 2 )->real;
//
- // the job goes to the idle selected builder nearest the site. A builder already on a
- // job is only taken when no idle one is selected, and with no builder selected at all
- // nothing is built.
+ // the job goes to the idle builder nearest the site - among the selected builders,
+ // or, with no builder selected (the stand-in builder command bar), among all the
+ // player's builders. A builder already on a job is only taken when no idle one exists.
//
BuilderPick pick;
+ pick.place = place;
pick.loc = loc;
pick.idle = pick.any = NULL;
pick.idleDistSqr = pick.anyDistSqr = 1e30f;
@@ -1847,6 +1860,8 @@ void GameLogic::logicMessageDispatcher( GameMessage *msg, AIGroup *orderedGroup
for( VecObjectID::const_iterator it = ids.begin(); it != ids.end(); ++it )
considerBuilder( TheGameLogic->findObjectByID( *it ), &pick );
}
+ if( pick.any == NULL && thisPlayer )
+ thisPlayer->iterateObjects( considerBuilderProc, &pick );
Object *constructorObject = pick.idle ? pick.idle : pick.any;
if( place == NULL || constructorObject == NULL )
diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/ScenarioDrill.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/ScenarioDrill.cpp
index 0ff427e2c..5cc7384c6 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/ScenarioDrill.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/ScenarioDrill.cpp
@@ -30,6 +30,7 @@
#include "Common/FileSystem.h"
#include "Common/GlobalData.h"
#include "Common/Player.h"
+#include "Common/MessageStream.h"
#include "Common/PlayerList.h"
#include "Common/SpecialPower.h"
#include "Common/Team.h"
@@ -202,6 +203,8 @@ static Bool parseActionType( const AsciiString &token, ScenarioActionType *actio
*action = SCENARIO_ACTION_SHIFTPOWER;
else if (token == "shiftupgrade")
*action = SCENARIO_ACTION_SHIFTUPGRADE;
+ else if (token == "construct")
+ *action = SCENARIO_ACTION_CONSTRUCT;
else
return FALSE;
@@ -283,6 +286,7 @@ static Int tokensNeededFor( ScenarioActionType action )
case SCENARIO_ACTION_SHIFTMOVE: return SCENARIO_TOKENS_MOVE;
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_SHIFTATTACK: return SCENARIO_TOKENS_ATTACK;
case SCENARIO_ACTION_SHIFTPOWER: return SCENARIO_TOKENS_SHIFTPOWER;
case SCENARIO_ACTION_SHIFTUPGRADE: return SCENARIO_TOKENS_SHIFTUPGRADE;
@@ -362,6 +366,7 @@ ScenarioParseResult ScenarioDrill_parseLine( const char *line, ScenarioAction *a
case SCENARIO_ACTION_SHIFTMOVE:
case SCENARIO_ACTION_SHIFTATTACKMOVE:
case SCENARIO_ACTION_SHIFTGUARD:
+ case SCENARIO_ACTION_CONSTRUCT:
{
Int next = SCENARIO_ORDER_POSITION_TOKEN;
const ScenarioParseResult position = parseScenarioPosition( tokens, count, &next, action );
@@ -1249,6 +1254,30 @@ static Bool executeOrder( const ScenarioAction &action, Player *player, const Co
return ordered;
}
+/** A placement click, as PlaceEventTranslator sends it: one MSG_DOZER_CONSTRUCT onto the message
+ stream, so it is recorded in the replay and reaches every machine of a network game, and the
+ logic picks the builder from whatever is selected then - with nothing selected, the player's idle
+ builder nearest the site. Only the local player can click, so any other slot is refused. */
+static Bool executeConstruct( const ScenarioAction &action, Player *player, const Coord3D &dest )
+{
+ const ThingTemplate *build = TheThingFactory->findTemplate( action.selector );
+ if (player != ThePlayerList->getLocalPlayer() || build == NULL)
+ {
+ DEBUG_LOG(("SCENARIO: frame %d construct: slot %d is not the local player, or '%s' is no template\n",
+ action.frame, action.slot, action.selector.str()));
+ return FALSE;
+ }
+
+ GameMessage *msg = TheMessageStream->appendMessage( GameMessage::MSG_DOZER_CONSTRUCT );
+ msg->appendIntegerArgument( build->getTemplateID() );
+ msg->appendLocationArgument( dest );
+ msg->appendRealArgument( 0.0f );
+
+ DEBUG_LOG(("SCENARIO: frame %d construct slot %d '%s' at (%.0f,%.0f)\n",
+ action.frame, action.slot, action.selector.str(), dest.x, dest.y));
+ return TRUE;
+}
+
Bool ScenarioDrill_execute( const ScenarioAction &action )
{
Player *player = findPlayerForSlot( action.slot );
@@ -1280,6 +1309,9 @@ Bool ScenarioDrill_execute( const ScenarioAction &action )
if (action.action == SCENARIO_ACTION_TALLY)
return executeTally( action, player );
+ if (action.action == SCENARIO_ACTION_CONSTRUCT)
+ return executeConstruct( action, player, position );
+
return executeOrder( action, player, position );
}