Cleanup: access escort's window location directly
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2781 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -274,9 +274,7 @@ ActivateStarShip (COUNT which_ship, SIZE state)
|
||||
|
||||
StarShipPtr = (SHIP_FRAGMENT*) LockStarShip (
|
||||
&GLOBAL (built_ship_q), hOldShip);
|
||||
// XXX: hack; escort window is not group loc,
|
||||
// should just use queue index (already var2)
|
||||
win_loc = GET_GROUP_LOC (StarShipPtr);
|
||||
win_loc = StarShipPtr->ShipInfo.var2;
|
||||
UnlockStarShip (&GLOBAL (built_ship_q), hOldShip);
|
||||
if (which_window <= win_loc)
|
||||
break;
|
||||
@@ -284,9 +282,7 @@ ActivateStarShip (COUNT which_ship, SIZE state)
|
||||
|
||||
StarShipPtr = (SHIP_FRAGMENT*) LockStarShip (
|
||||
&GLOBAL (built_ship_q), hStarShip);
|
||||
// XXX: hack; escort window is not group loc,
|
||||
// should just use queue index (already var2)
|
||||
SET_GROUP_LOC (StarShipPtr, which_window - 1);
|
||||
StarShipPtr->ShipInfo.var2 = which_window - 1;
|
||||
UnlockStarShip (&GLOBAL (built_ship_q), hStarShip);
|
||||
|
||||
InsertQueue (&GLOBAL (built_ship_q), hStarShip, hOldShip);
|
||||
|
||||
@@ -370,7 +370,7 @@ ShowCombatShip (COUNT which_window, SHIP_FRAGMENT *YankedStarShipPtr)
|
||||
{
|
||||
StarShipPtr = (SHIP_FRAGMENT*) LockStarShip (
|
||||
&GLOBAL (built_ship_q), hStarShip);
|
||||
if (GET_GROUP_LOC (StarShipPtr) > which_window)
|
||||
if (StarShipPtr->ShipInfo.var2 > which_window)
|
||||
{
|
||||
UnlockStarShip (&GLOBAL (built_ship_q), hStarShip);
|
||||
break;
|
||||
@@ -385,9 +385,7 @@ ShowCombatShip (COUNT which_window, SHIP_FRAGMENT *YankedStarShipPtr)
|
||||
hStarShip = hTailShip;
|
||||
StarShipPtr = (SHIP_FRAGMENT*) LockStarShip (
|
||||
&GLOBAL (built_ship_q), hStarShip);
|
||||
// XXX: hack; escort window is not group loc,
|
||||
// should just use queue index (already var2)
|
||||
SET_GROUP_LOC (StarShipPtr, which_window);
|
||||
StarShipPtr->ShipInfo.var2 = which_window;
|
||||
UnlockStarShip (&GLOBAL (built_ship_q), hStarShip);
|
||||
}
|
||||
|
||||
@@ -656,9 +654,7 @@ DoModifyShips (MENU_STATE *pMS)
|
||||
StarShipPtr = (SHIP_FRAGMENT*) LockStarShip (
|
||||
&GLOBAL (built_ship_q), hStarShip);
|
||||
|
||||
// XXX: hack; escort window is not group loc,
|
||||
// should just use queue index (already var2)
|
||||
if (GET_GROUP_LOC (StarShipPtr) == pMS->CurState)
|
||||
if (StarShipPtr->ShipInfo.var2 == pMS->CurState)
|
||||
{
|
||||
UnlockStarShip (&GLOBAL (built_ship_q), hStarShip);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user