rem: if (!AllDoorsFinished)
add: if (!AllDoorsFinished || YankedStarShipPtr)
context: ShowCombatShip (COUNT which_window, SHIP_FRAGMENTPTR YankedStarShipPtr){	COUNT i, num_ships;	HSTARSHIP hStarShip, hNextShip;	SHIP_FRAGMENTPTR StarShipPtr;	struct	{		SHIP_FRAGMENTPTR StarShipPtr;		POINT finished_s;		STAMP ship_s, lfdoor_s, rtdoor_s;	} ship_win_info[MAX_COMBAT_SHIPS], *pship_win_info;	COORD x_coords[] =	{		19, 60, 116, 157,	};	num_ships = 1;	pship_win_info = &ship_win_info[0];	if (YankedStarShipPtr)	{		pship_win_info->StarShipPtr = YankedStarShipPtr;		pship_win_info->lfdoor_s.origin.x = -(SHIP_WIN_WIDTH >> 1);		pship_win_info->rtdoor_s.origin.x = (SHIP_WIN_WIDTH >> 1);		pship_win_info->lfdoor_s.origin.y =				pship_win_info->rtdoor_s.origin.y = 0;		pship_win_info->lfdoor_s.frame =				IncFrameIndex (pMenuState->ModuleFrame);		pship_win_info->rtdoor_s.frame =				IncFrameIndex (pship_win_info->lfdoor_s.frame);		pship_win_info->ship_s.origin.x = (SHIP_WIN_WIDTH >> 1) + 1;		pship_win_info->ship_s.origin.y = (SHIP_WIN_WIDTH >> 1);		pship_win_info->ship_s.frame =				YankedStarShipPtr->ShipInfo.melee_icon;		pship_win_info->finished_s.x = x_coords[which_window & 3];		pship_win_info->finished_s.y = 64 + (44 * (which_window >> 2));	}	else	{		if (which_window == (COUNT)~0)		{			hStarShip = GetHeadLink (&GLOBAL (built_ship_q));			num_ships = CountLinks (&GLOBAL (built_ship_q));		}		else		{			HSTARSHIP hTailShip;			hTailShip = GetTailLink (&GLOBAL (built_ship_q));			RemoveQueue (&GLOBAL (built_ship_q), hTailShip);			hStarShip = GetHeadLink (&GLOBAL (built_ship_q));			while (hStarShip)			{				StarShipPtr = (SHIP_FRAGMENTPTR)LockStarShip (						&GLOBAL (built_ship_q),						hStarShip						);				if (GET_GROUP_LOC (StarShipPtr) > which_window)				{					UnlockStarShip (							&GLOBAL (built_ship_q),							hStarShip							);					break;				}				hNextShip = _GetSuccLink (StarShipPtr);				UnlockStarShip (						&GLOBAL (built_ship_q),						hStarShip						);				hStarShip = hNextShip;			}			InsertQueue (&GLOBAL (built_ship_q),					hTailShip, hStarShip);			hStarShip = hTailShip;			StarShipPtr = (SHIP_FRAGMENTPTR)LockStarShip (					&GLOBAL (built_ship_q),					hStarShip					);			SET_GROUP_LOC (StarShipPtr, which_window);			UnlockStarShip (					&GLOBAL (built_ship_q),					hStarShip					);		}		for (i = 0; i < num_ships; ++i)		{			StarShipPtr = (SHIP_FRAGMENTPTR)LockStarShip (					&GLOBAL (built_ship_q),					hStarShip					);			hNextShip = _GetSuccLink (StarShipPtr);			pship_win_info->StarShipPtr = StarShipPtr;			pship_win_info->lfdoor_s.origin.x = -1;			pship_win_info->rtdoor_s.origin.x = 1;			pship_win_info->lfdoor_s.origin.y =					pship_win_info->rtdoor_s.origin.y = 0;			pship_win_info->lfdoor_s.frame =					IncFrameIndex (pMenuState->ModuleFrame);			pship_win_info->rtdoor_s.frame =					IncFrameIndex (pship_win_info->lfdoor_s.frame);			pship_win_info->ship_s.origin.x = (SHIP_WIN_WIDTH >> 1) + 1;			pship_win_info->ship_s.origin.y = (SHIP_WIN_WIDTH >> 1);			pship_win_info->ship_s.frame =					StarShipPtr->ShipInfo.melee_icon;			which_window = GET_GROUP_LOC (StarShipPtr);			pship_win_info->finished_s.x = x_coords[which_window & 3];			pship_win_info->finished_s.y = 64 + (44 * (which_window >> 2));			++pship_win_info;			UnlockStarShip (					&GLOBAL (built_ship_q),					hStarShip					);			hStarShip = hNextShip;		}	}	if (num_ships)	{		BYTE ButtonState;		BOOLEAN AllDoorsFinished;		DWORD TimeIn;		RECT r;		CONTEXT OldContext;		int j;		SetSemaphore (GraphicsSem);		OldContext = SetContext (OffScreenContext);		SetContextFGFrame (Screen);		SetContextBackGroundColor (BLACK_COLOR);		AllDoorsFinished = FALSE;		r.corner.x = r.corner.y = 0;		r.extent.width = SHIP_WIN_WIDTH;		r.extent.height = SHIP_WIN_HEIGHT;		ButtonState = AnyButtonPress (FALSE) ? 1 : 0;		TimeIn = GetTimeCounter ();		for (j = 0; (j < SHIP_WIN_FRAMES) && !AllDoorsFinished; j++)		{			ClearSemaphore (GraphicsSem);			SleepThreadUntil (TimeIn + 5);			TimeIn = GetTimeCounter ();			SetSemaphore (GraphicsSem);			BatchGraphics ();StartFinalPass:			pship_win_info = &ship_win_info[0];			for (i = 0; i < num_ships; ++i)			{				if (ButtonState)				{					if (!AnyButtonPress (FALSE))						ButtonState = 0;				}				else if (AnyButtonPress (FALSE))				{					if (YankedStarShipPtr == 0)						AllDoorsFinished = TRUE;					else					{						pship_win_info->lfdoor_s.origin.x =								pship_win_info->rtdoor_s.origin.x = 0;						AllDoorsFinished = TRUE;					}					goto StartFinalPass;				}				{					RECT ClipRect;					ClipRect.corner.x = SIS_ORG_X + pship_win_info->finished_s.x;					ClipRect.corner.y = SIS_ORG_Y + pship_win_info->finished_s.y;					ClipRect.extent.width = SHIP_WIN_WIDTH;					ClipRect.extent.height = SHIP_WIN_HEIGHT;					SetContextClipRect (&ClipRect);										ClearDrawable ();					DrawStamp (&pship_win_info->ship_s);					ShowShipCrew (pship_win_info->StarShipPtr, &r);					if (!AllDoorsFinished)					{						DrawStamp (&pship_win_info->lfdoor_s);						DrawStamp (&pship_win_info->rtdoor_s);						if (YankedStarShipPtr)						{							++pship_win_info->lfdoor_s.origin.x;							--pship_win_info->rtdoor_s.origin.x;						}						else						{							--pship_win_info->lfdoor_s.origin.x;							++pship_win_info->rtdoor_s.origin.x;						}					}				}				++pship_win_info;			}			UnbatchGraphics ();		}		SetContextClipRect (NULL_PTR);		SetContext (OldContext);		ClearSemaphore (GraphicsSem);	}}