Skip to content

Commit

Permalink
Display order arrow, when queueing modules to be built.
Browse files Browse the repository at this point in the history
Also, simplified
  if (!bOrderEffectDisplayed && (psOrder->order != DORDER_BUILD || psOrder->order != DORDER_LINEBUILD || psOrder->order != DORDER_BUILDMODULE || psOrder->order != DORDER_HELPBUILD))
to
  if (!bOrderEffectDisplayed)
since psOrder could never be all of DORDER_BUILD, DORDER_LINEBUILD, DORDER_BUILDMODULE and DORDER_HELPBUILD simultaneously. The original condition was
  if (!bOrderEffectDisplayed AND (psOrder->order != DORDER_BUILD OR
       psOrder->order != DORDER_LINEBUILD OR psOrder->order !=
       DORDER_BUILDMODULE OR psOrder->order != DORDER_HELPBUILD))
which uses AND and OR, instead of && and ||, but didn't make much sense, either.

Fixes ticket:2602. Fixes ticket:2732.
  • Loading branch information
Cyp committed Nov 17, 2011
1 parent a4ac615 commit a6c3079
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/order.cpp
Expand Up @@ -2363,12 +2363,19 @@ void orderDroidAddPending(DROID *psDroid, DROID_ORDER_DATA *psOrder)

psDroid->asOrderList.push_back(orderDataToOrderList(psOrder));

//don't display the arrow-effects with build orders since unnecessary
if (!bOrderEffectDisplayed && (psOrder->order != DORDER_BUILD || psOrder->order != DORDER_LINEBUILD || psOrder->order != DORDER_BUILDMODULE || psOrder->order != DORDER_HELPBUILD))
// Only display one arrow, bOrderEffectDisplayed must be set to false once per arrow.
if (!bOrderEffectDisplayed)
{
Vector3i position;
position.x = psOrder->x;
position.z = psOrder->y;
if (psOrder->psObj == NULL)
{
position.x = psOrder->x;
position.z = psOrder->y;
}
else
{
position = swapYZ(psOrder->psObj->pos);
}
position.y = map_Height(position.x, position.z) + 32;
if (psOrder->psObj != NULL && psOrder->psObj->sDisplay.imd != NULL)
{
Expand Down

0 comments on commit a6c3079

Please sign in to comment.