From 3da5e55c1c8867ef3e071785c3406be68687bd34 Mon Sep 17 00:00:00 2001 From: Meep-Eep Date: Sun, 8 Jan 2012 13:49:39 +0000 Subject: [PATCH] Fix flashing when pressing the 'spin ship' button on an empty slot or the flag ship. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3741 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/uqm/shipyard.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/sc2/src/uqm/shipyard.c b/sc2/src/uqm/shipyard.c index 87436c36a..6a1f7a388 100644 --- a/sc2/src/uqm/shipyard.c +++ b/sc2/src/uqm/shipyard.c @@ -712,10 +712,7 @@ DMS_SpinShip (MENU_STATE *pMS, HSHIPFRAG hStarShip) SetContextClipRect (&OldClipRect); SetContext (OldContext); - if (hStarShip) - return TRUE; - - return FALSE; + return TRUE; } #endif /* WANT_SHIP_SPINS */ @@ -985,9 +982,9 @@ DMS_AddEscortShip (MENU_STATE *pMS, BOOLEAN special, BOOLEAN select, if (special) { HSHIPFRAG hStarShip = GetEscortByStarShipIndex (pMS->delta_item); - DMS_SpinShip (pMS, hStarShip); LockMutex (GraphicsLock); - DMS_SetMode (pMS, DMS_Mode_addEscort); + if (DMS_SpinShip (pMS, hStarShip)) + DMS_SetMode (pMS, DMS_Mode_addEscort); UnlockMutex (GraphicsLock); return; } @@ -1169,8 +1166,8 @@ DMS_NavigateShipSlots (MENU_STATE *pMS, BOOLEAN special, BOOLEAN select, #else if (special) { - DMS_SpinShip (pMS, hStarShip); - DMS_SetMode (pMS, DMS_Mode_navigate); + if (DMS_SpinShip (pMS, hStarShip)) + DMS_SetMode (pMS, DMS_Mode_navigate); } else #endif /* WANT_SHIP_SPINS */