Skip to content

Commit

Permalink
Fix desynch on unassigning droids from commander.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyp committed Jan 9, 2011
1 parent b143d53 commit b4c9ca5
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions src/order.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2146,7 +2146,7 @@ void orderDroidLoc(DROID *psDroid, DROID_ORDER order, UDWORD x, UDWORD y, QUEUE_
ASSERT_OR_RETURN(, psDroid != NULL, "Invalid unit pointer");
ASSERT_OR_RETURN(, validOrderForLoc(order), "Invalid order for location");

if (mode == ModeQueue && bMultiPlayer) //ajl
if (mode == ModeQueue) //ajl
{
sendDroidInfo(psDroid, order, x, y, NULL, NULL, 0, 0, 0, false);
return; // Wait to receive our order before changing the droid.
Expand Down Expand Up @@ -2206,7 +2206,7 @@ void orderDroidObj(DROID *psDroid, DROID_ORDER order, BASE_OBJECT *psObj, QUEUE_
ASSERT(validOrderForObj(order), "Invalid order for object");
ASSERT(!isBlueprint(psObj), "Target is a blueprint");

if (mode == ModeQueue && bMultiPlayer) //ajl
if (mode == ModeQueue) //ajl
{
sendDroidInfo(psDroid, order, 0, 0, psObj, NULL, 0, 0, 0, false);
return; // Wait for the order to be received before changing the droid.
Expand Down Expand Up @@ -2733,15 +2733,6 @@ void orderSelectedLoc(uint32_t player, uint32_t x, uint32_t y, bool add)
return;
}

// remove any units from their command group
for(psCurr = apsDroidLists[player]; psCurr; psCurr=psCurr->psNext)
{
if (psCurr->selected && hasCommander(psCurr))
{
grpLeave(psCurr->psGroup, psCurr);
}
}

// note that an order list graphic needs to be displayed
bOrderEffectDisplayed = false;

Expand Down Expand Up @@ -3067,15 +3058,6 @@ void orderSelectedObjAdd(UDWORD player, BASE_OBJECT *psObj, BOOL add)
DROID *psCurr;
DROID_ORDER order;

// remove any units from their command group
for(psCurr = apsDroidLists[player]; psCurr; psCurr=psCurr->psNext)
{
if (psCurr->selected && hasCommander(psCurr))
{
grpLeave(psCurr->psGroup, psCurr);
}
}

// note that an order list graphic needs to be displayed
bOrderEffectDisplayed = false;

Expand Down

0 comments on commit b4c9ca5

Please sign in to comment.