Disentangled ESCORT_WORTH and ESCORTING_FLAGSHIP for better readability
and to get rid of a warning. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1392 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
+22
-16
@@ -123,38 +123,44 @@ ActivateStarShip (COUNT which_ship, SIZE state)
|
|||||||
return (which_ship);
|
return (which_ship);
|
||||||
}
|
}
|
||||||
case ESCORT_WORTH:
|
case ESCORT_WORTH:
|
||||||
which_ship = 0;
|
|
||||||
case ESCORTING_FLAGSHIP:
|
|
||||||
{
|
{
|
||||||
COUNT ShipCost[] =
|
COUNT ShipCost[] =
|
||||||
{
|
{
|
||||||
RACE_SHIP_COST
|
RACE_SHIP_COST
|
||||||
};
|
};
|
||||||
|
COUNT total = 0;
|
||||||
|
|
||||||
|
for (hStarShip = GetHeadLink (&GLOBAL (built_ship_q));
|
||||||
|
hStarShip; hStarShip = hNextShip)
|
||||||
|
{
|
||||||
|
SHIP_FRAGMENTPTR StarShipPtr;
|
||||||
|
|
||||||
|
StarShipPtr = (SHIP_FRAGMENTPTR) LockStarShip (
|
||||||
|
&GLOBAL (built_ship_q), hStarShip);
|
||||||
|
hNextShip = _GetSuccLink (StarShipPtr);
|
||||||
|
total += ShipCost[GET_RACE_ID (StarShipPtr)];
|
||||||
|
UnlockStarShip (&GLOBAL (built_ship_q), hStarShip);
|
||||||
|
}
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
case ESCORTING_FLAGSHIP:
|
||||||
|
{
|
||||||
for (hStarShip = GetHeadLink (&GLOBAL (built_ship_q));
|
for (hStarShip = GetHeadLink (&GLOBAL (built_ship_q));
|
||||||
hStarShip; hStarShip = hNextShip)
|
hStarShip; hStarShip = hNextShip)
|
||||||
{
|
{
|
||||||
BYTE ship_type;
|
BYTE ship_type;
|
||||||
SHIP_FRAGMENTPTR StarShipPtr;
|
SHIP_FRAGMENTPTR StarShipPtr;
|
||||||
|
|
||||||
StarShipPtr = (SHIP_FRAGMENTPTR)LockStarShip (
|
StarShipPtr = (SHIP_FRAGMENTPTR) LockStarShip (
|
||||||
&GLOBAL (built_ship_q), hStarShip
|
&GLOBAL (built_ship_q), hStarShip);
|
||||||
);
|
|
||||||
hNextShip = _GetSuccLink (StarShipPtr);
|
hNextShip = _GetSuccLink (StarShipPtr);
|
||||||
if (state == ESCORT_WORTH)
|
|
||||||
which_ship += ShipCost[GET_RACE_ID (StarShipPtr)];
|
|
||||||
else
|
|
||||||
ship_type = GET_RACE_ID (StarShipPtr);
|
ship_type = GET_RACE_ID (StarShipPtr);
|
||||||
UnlockStarShip (
|
UnlockStarShip (&GLOBAL (built_ship_q), hStarShip);
|
||||||
&GLOBAL (built_ship_q), hStarShip
|
|
||||||
);
|
|
||||||
|
|
||||||
if (state != ESCORT_WORTH
|
if ((COUNT) ship_type == which_ship)
|
||||||
&& (COUNT)ship_type == which_ship)
|
return 1;
|
||||||
return (1);
|
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
return (state == ESCORTING_FLAGSHIP ? 0 : which_ship);
|
|
||||||
}
|
}
|
||||||
case FEASIBILITY_STUDY:
|
case FEASIBILITY_STUDY:
|
||||||
return (MAX_BUILT_SHIPS
|
return (MAX_BUILT_SHIPS
|
||||||
|
|||||||
Reference in New Issue
Block a user