Skip to content

Commit b074cac

Browse files
committed
fix selection issues (hopefully)
1 parent 763c773 commit b074cac

1 file changed

Lines changed: 16 additions & 22 deletions

File tree

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Contain/JumpjetContain.cpp

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include "Common/RandomValue.h"
3636
#include "Common/ThingTemplate.h"
3737
#include "Common/Xfer.h"
38-
38+
#include "Common/PlayerList.h"
3939
#include "GameLogic/AIPathfind.h"
4040
#include "GameLogic/Locomotor.h"
4141
#include "GameLogic/Module/AIUpdate.h"
@@ -44,7 +44,7 @@
4444
#include "GameLogic/Module/PhysicsUpdate.h"
4545
#include "GameLogic/Object.h"
4646
#include "GameLogic/PartitionManager.h"
47-
47+
#include "GameClient/InGameUI.h"
4848
#include "GameClient/Drawable.h"
4949

5050

@@ -293,27 +293,21 @@ void JumpjetContain::onRemoving(Object* rider)
293293
}
294294
else
295295
{
296-
bool hasRallyPoint = false;
297-
// Get the transport of the rider
298-
Object* transport = TheGameLogic->findObjectByID(rider->getProducerID());
299-
if (transport)
300-
{
301-
// Get the building that produced the transport
302-
Object* transportProducer = TheGameLogic->findObjectByID(transport->getProducerID());
303-
if (transportProducer)
304-
{
305-
// See if we need to set a rally point for the object being parachuted
306-
ExitInterface* exitInterface = transportProducer->getObjectExitInterface();
307-
if (exitInterface && exitInterface->useSpawnRallyPoint())
308-
{
309-
exitInterface->exitObjectViaDoor(rider, DOOR_1);
310-
hasRallyPoint = true;
311-
}
312-
}
313-
}
296+
riderAI->aiIdle(CMD_FROM_AI); // become idle.
297+
}
298+
}
314299

315-
if (!hasRallyPoint)
316-
riderAI->aiIdle(CMD_FROM_AI); // become idle.
300+
if (rider->getControllingPlayer() == ThePlayerList->getLocalPlayer())
301+
{
302+
Drawable* riderDraw = rider->getDrawable();
303+
if (riderDraw && riderDraw->isSelected())
304+
{
305+
// add to the current selection (don't clobber other units, e.g. group jumpjet launches)
306+
GameMessage* teamMsg = TheMessageStream->appendMessage(GameMessage::MSG_CREATE_SELECTED_GROUP);
307+
teamMsg->appendBooleanArgument(FALSE);
308+
teamMsg->appendObjectIDArgument(rider->getID());
309+
TheInGameUI->selectDrawable(riderDraw);
310+
TheInGameUI->setDisplayedMaxWarning(FALSE);
317311
}
318312
}
319313

0 commit comments

Comments
 (0)