Fixed bug introduced by the fix for #413.

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1486 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
meep-eep
2005-01-23 12:24:15 +00:00
parent 38f02deb92
commit ef3f8e8ebc
+17 -4
View File
@@ -805,14 +805,19 @@ DoModifyShips (PMENU_STATE pMS)
else if (select || cancel)
{
if ((pMS->delta_item & MODIFY_CREW_FLAG)
&& hStarShip != 0
&& StarShipPtr->ShipInfo.crew_level == 0)
&& hStarShip != 0)
{
StarShipPtr = (SHIP_FRAGMENTPTR)LockStarShip (
&GLOBAL (built_ship_q), hStarShip);
if (StarShipPtr->ShipInfo.crew_level == 0)
{
SetFlashRect (NULL_PTR, (FRAME)0);
UnlockMutex (GraphicsLock);
ShowCombatShip ((COUNT)pMS->CurState, StarShipPtr);
ShowCombatShip ((COUNT)pMS->CurState,
StarShipPtr);
LockMutex (GraphicsLock);
UnlockStarShip (&GLOBAL (built_ship_q), hStarShip);
UnlockStarShip (&GLOBAL (built_ship_q),
hStarShip);
RemoveQueue (&GLOBAL (built_ship_q), hStarShip);
FreeStarShip (&GLOBAL (built_ship_q), hStarShip);
// refresh SIS display
@@ -826,6 +831,12 @@ DoModifyShips (PMENU_STATE pMS)
SetContext (SpaceContext);
SetFlashRect (&r, (FRAME)0);
}
else
{
UnlockStarShip (&GLOBAL (built_ship_q),
hStarShip);
}
}
if (!(pMS->delta_item ^= MODIFY_CREW_FLAG))
{
@@ -860,6 +871,8 @@ DoModifyShips (PMENU_STATE pMS)
if (hStarShip)
StarShipPtr = (SHIP_FRAGMENTPTR)LockStarShip (
&GLOBAL (built_ship_q), hStarShip);
else
StarShipPtr = NULL; // Keeping compiler quiet.
SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN,
MENU_SOUND_SELECT | MENU_SOUND_CANCEL);