Fix droid order lists not getting cleared when giving a non-queued order.
Ended up removing SendGroupOrderSelected in the process.master
parent
711f5ebc97
commit
d8fbf4bccc
|
@ -490,27 +490,6 @@ BOOL recvDroid(NETQUEUE queue)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ////////////////////////////////////////////////////////////////////////////
|
|
||||||
/*!
|
|
||||||
* Droid Group/selection orders.
|
|
||||||
* The SendDroidInfo function minimises comms by sending orders for whole groups, rather than each droid.
|
|
||||||
*/
|
|
||||||
BOOL SendGroupOrderSelected(uint8_t player, uint32_t x, uint32_t y, const BASE_OBJECT* psObj, BOOL altOrder)
|
|
||||||
{
|
|
||||||
if (!bMultiMessages)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
for (DROID *psDroid = apsDroidLists[player]; psDroid != NULL; psDroid = psDroid->psNext)
|
|
||||||
{
|
|
||||||
if (psDroid->selected)
|
|
||||||
{
|
|
||||||
DROID_ORDER order = psObj? chooseOrderObj(psDroid, const_cast<BASE_OBJECT *>(psObj), altOrder) : chooseOrderLoc(psDroid, x, y, altOrder);
|
|
||||||
SendDroidInfo(psDroid, order, x, y, psObj, NULL, 0, 0, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* This routine is called by the AI scripts
|
* This routine is called by the AI scripts
|
||||||
*
|
*
|
||||||
|
|
|
@ -184,7 +184,6 @@ extern BOOL SendDestroyDroid (const DROID* psDroid);
|
||||||
extern BOOL SendDemolishFinished(STRUCTURE *psS,DROID *psD);
|
extern BOOL SendDemolishFinished(STRUCTURE *psS,DROID *psD);
|
||||||
void sendQueuedDroidInfo(void); ///< Actually sends the droid orders which were queued by SendDroidInfo.
|
void sendQueuedDroidInfo(void); ///< Actually sends the droid orders which were queued by SendDroidInfo.
|
||||||
extern BOOL SendDroidInfo (const DROID* psDroid, DROID_ORDER order, uint32_t x, uint32_t y, const BASE_OBJECT* psObj, const BASE_STATS *psStats, uint32_t x2, uint32_t y2, uint16_t direction);
|
extern BOOL SendDroidInfo (const DROID* psDroid, DROID_ORDER order, uint32_t x, uint32_t y, const BASE_OBJECT* psObj, const BASE_STATS *psStats, uint32_t x2, uint32_t y2, uint16_t direction);
|
||||||
extern BOOL SendGroupOrderSelected(uint8_t player, uint32_t x, uint32_t y, const BASE_OBJECT* psObj, BOOL altOrder);
|
|
||||||
extern BOOL SendCmdGroup (DROID_GROUP *psGroup, UWORD x, UWORD y, BASE_OBJECT *psObj);
|
extern BOOL SendCmdGroup (DROID_GROUP *psGroup, UWORD x, UWORD y, BASE_OBJECT *psObj);
|
||||||
|
|
||||||
extern BOOL SendGroupOrderGroup(const DROID_GROUP* psGroup, DROID_ORDER order, uint32_t x, uint32_t y, const BASE_OBJECT* psObj);
|
extern BOOL SendGroupOrderGroup(const DROID_GROUP* psGroup, DROID_ORDER order, uint32_t x, uint32_t y, const BASE_OBJECT* psObj);
|
||||||
|
|
30
src/order.c
30
src/order.c
|
@ -2105,6 +2105,8 @@ void orderDroid(DROID *psDroid, DROID_ORDER order, QUEUE_MODE mode)
|
||||||
order == DORDER_TEMP_HOLD,
|
order == DORDER_TEMP_HOLD,
|
||||||
"orderUnit: Invalid order" );
|
"orderUnit: Invalid order" );
|
||||||
|
|
||||||
|
orderClearDroidList(psDroid);
|
||||||
|
|
||||||
memset(&sOrder,0,sizeof(DROID_ORDER_DATA));
|
memset(&sOrder,0,sizeof(DROID_ORDER_DATA));
|
||||||
sOrder.order = order;
|
sOrder.order = order;
|
||||||
|
|
||||||
|
@ -2146,14 +2148,14 @@ void orderDroidLoc(DROID *psDroid, DROID_ORDER order, UDWORD x, UDWORD y, QUEUE_
|
||||||
ASSERT_OR_RETURN(, psDroid != NULL, "Invalid unit pointer");
|
ASSERT_OR_RETURN(, psDroid != NULL, "Invalid unit pointer");
|
||||||
ASSERT_OR_RETURN(, validOrderForLoc(order), "Invalid order for location");
|
ASSERT_OR_RETURN(, validOrderForLoc(order), "Invalid order for location");
|
||||||
|
|
||||||
|
orderClearDroidList(psDroid);
|
||||||
|
|
||||||
if (mode == ModeQueue && bMultiPlayer) //ajl
|
if (mode == ModeQueue && bMultiPlayer) //ajl
|
||||||
{
|
{
|
||||||
SendDroidInfo(psDroid, order, x, y, NULL, NULL, 0, 0, 0);
|
SendDroidInfo(psDroid, order, x, y, NULL, NULL, 0, 0, 0);
|
||||||
return; // Wait to receive our order before changing the droid.
|
return; // Wait to receive our order before changing the droid.
|
||||||
}
|
}
|
||||||
|
|
||||||
orderClearDroidList(psDroid);
|
|
||||||
|
|
||||||
memset(&sOrder,0,sizeof(DROID_ORDER_DATA));
|
memset(&sOrder,0,sizeof(DROID_ORDER_DATA));
|
||||||
sOrder.order = order;
|
sOrder.order = order;
|
||||||
sOrder.x = (UWORD)x;
|
sOrder.x = (UWORD)x;
|
||||||
|
@ -2205,14 +2207,14 @@ void orderDroidObj(DROID *psDroid, DROID_ORDER order, BASE_OBJECT *psObj, QUEUE_
|
||||||
ASSERT(psDroid != NULL, "Invalid unit pointer");
|
ASSERT(psDroid != NULL, "Invalid unit pointer");
|
||||||
ASSERT(validOrderForObj(order), "Invalid order for object");
|
ASSERT(validOrderForObj(order), "Invalid order for object");
|
||||||
|
|
||||||
|
orderClearDroidList(psDroid);
|
||||||
|
|
||||||
if (mode == ModeQueue && bMultiPlayer) //ajl
|
if (mode == ModeQueue && bMultiPlayer) //ajl
|
||||||
{
|
{
|
||||||
SendDroidInfo(psDroid, order, 0, 0, psObj, NULL, 0, 0, 0);
|
SendDroidInfo(psDroid, order, 0, 0, psObj, NULL, 0, 0, 0);
|
||||||
return; // Wait for the order to be received before changing the droid.
|
return; // Wait for the order to be received before changing the droid.
|
||||||
}
|
}
|
||||||
|
|
||||||
orderClearDroidList(psDroid);
|
|
||||||
|
|
||||||
memset(&sOrder,0,sizeof(DROID_ORDER_DATA));
|
memset(&sOrder,0,sizeof(DROID_ORDER_DATA));
|
||||||
sOrder.order = order;
|
sOrder.order = order;
|
||||||
sOrder.psObj = psObj;
|
sOrder.psObj = psObj;
|
||||||
|
@ -2313,6 +2315,8 @@ void orderDroidStatsLocDir(DROID *psDroid, DROID_ORDER order, BASE_STATS *psStat
|
||||||
ASSERT(psDroid != NULL, "Invalid unit pointer");
|
ASSERT(psDroid != NULL, "Invalid unit pointer");
|
||||||
ASSERT(order == DORDER_BUILD, "Invalid order for location");
|
ASSERT(order == DORDER_BUILD, "Invalid order for location");
|
||||||
|
|
||||||
|
orderClearDroidList(psDroid);
|
||||||
|
|
||||||
if (mode == ModeQueue && bMultiPlayer)
|
if (mode == ModeQueue && bMultiPlayer)
|
||||||
{
|
{
|
||||||
SendDroidInfo(psDroid, order, x, y, NULL, psStats, 0, 0, direction);
|
SendDroidInfo(psDroid, order, x, y, NULL, psStats, 0, 0, direction);
|
||||||
|
@ -2360,6 +2364,8 @@ void orderDroidStatsTwoLocDir(DROID *psDroid, DROID_ORDER order, BASE_STATS *psS
|
||||||
ASSERT(order == DORDER_LINEBUILD, "Invalid order for location");
|
ASSERT(order == DORDER_LINEBUILD, "Invalid order for location");
|
||||||
ASSERT(x1 == x2 || y1 == y2, "Invalid locations for LINEBUILD");
|
ASSERT(x1 == x2 || y1 == y2, "Invalid locations for LINEBUILD");
|
||||||
|
|
||||||
|
orderClearDroidList(psDroid);
|
||||||
|
|
||||||
if (mode == ModeQueue && bMultiPlayer)
|
if (mode == ModeQueue && bMultiPlayer)
|
||||||
{
|
{
|
||||||
SendDroidInfo(psDroid, order, x1, y1, NULL, psStats, x2, y2, direction);
|
SendDroidInfo(psDroid, order, x1, y1, NULL, psStats, x2, y2, direction);
|
||||||
|
@ -2754,13 +2760,6 @@ void orderSelectedLoc(uint32_t player, uint32_t x, uint32_t y, bool add)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!add && bMultiMessages && SendGroupOrderSelected((UBYTE)player,x,y,NULL,keyDown(KEY_LALT) || keyDown(KEY_RALT)) )
|
|
||||||
{ // turn off multiplay messages,since we've send a group one instead.
|
|
||||||
// note that an order list graphic needs to be displayed
|
|
||||||
bOrderEffectDisplayed = false;
|
|
||||||
return; // Wait to receive our order before changing the droids.
|
|
||||||
}
|
|
||||||
|
|
||||||
// remove any units from their command group
|
// remove any units from their command group
|
||||||
for(psCurr = apsDroidLists[player]; psCurr; psCurr=psCurr->psNext)
|
for(psCurr = apsDroidLists[player]; psCurr; psCurr=psCurr->psNext)
|
||||||
{
|
{
|
||||||
|
@ -3125,15 +3124,6 @@ void orderSelectedObjAdd(UDWORD player, BASE_OBJECT *psObj, BOOL add)
|
||||||
DROID *psCurr, *psDemolish;
|
DROID *psCurr, *psDemolish;
|
||||||
DROID_ORDER order;
|
DROID_ORDER order;
|
||||||
|
|
||||||
if (!add && bMultiMessages && SendGroupOrderSelected((UBYTE)player,0,0,psObj,keyDown(KEY_LALT) || keyDown(KEY_RALT)) )
|
|
||||||
{ // turn off multiplay messages,since we've send a group one instead.
|
|
||||||
// note that an order list graphic needs to be displayed
|
|
||||||
bOrderEffectDisplayed = false;
|
|
||||||
orderPlayOrderObjAudio(player, psObj);
|
|
||||||
return; // Wait to receive our order before changing anything.
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// remove any units from their command group
|
// remove any units from their command group
|
||||||
for(psCurr = apsDroidLists[player]; psCurr; psCurr=psCurr->psNext)
|
for(psCurr = apsDroidLists[player]; psCurr; psCurr=psCurr->psNext)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue