From a784ebc0822689008efff77cb49ff3d76263dfff Mon Sep 17 00:00:00 2001 From: avolkov Date: Thu, 29 Dec 2005 16:11:08 +0000 Subject: [PATCH] Allow selecting scan methods for shielded and gas giant planets with PC menus; bug #800 git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2140 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/planets/scan.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/sc2/src/sc2code/planets/scan.c b/sc2/src/sc2code/planets/scan.c index 58416d1d8..4e0b6f8a0 100644 --- a/sc2/src/sc2code/planets/scan.c +++ b/sc2/src/sc2code/planets/scan.c @@ -990,6 +990,15 @@ DoScan (PMENU_STATE pMS) COUNT fuel_required; UNICODE buf[20]; + if ((pSolarSysState->pOrbitalDesc->data_index & PLANET_SHIELDED) + || (pSolarSysState->SysInfo.PlanetInfo.AtmoDensity == + GAS_GIANT_ATMOSPHERE)) + { // cannot dispatch to shielded planets or gas giants + PlaySoundEffect (SetAbsSoundIndex (MenuSounds, 2), + 0, NotPositional (), NULL, GAME_SOUND_PRIORITY); + return (TRUE); + } + fuel_required = (COUNT)( pSolarSysState->SysInfo.PlanetInfo.SurfaceGravity << 1 ); @@ -1026,10 +1035,19 @@ DoScan (PMENU_STATE pMS) return PickPlanetSide (pMS); } + // Various scans + if (pSolarSysState->pOrbitalDesc->data_index & PLANET_SHIELDED) + { // cannot scan shielded planets + PlaySoundEffect (SetAbsSoundIndex (MenuSounds, 2), + 0, NotPositional (), NULL, GAME_SOUND_PRIORITY); + return (TRUE); + } + pSolarSysState->MenuState.Initialized += 4; #ifndef SPIN_ON_SCAN pSolarSysState->PauseRotate = 1; #endif + min_scan = pMS->CurState; if (min_scan != AUTO_SCAN) max_scan = min_scan; @@ -1165,9 +1183,10 @@ DoScan (PMENU_STATE pMS) pSolarSysState->PauseRotate = 0; FlushInput (); } - else if (!(pSolarSysState->pOrbitalDesc->data_index & PLANET_SHIELDED) + else if (optWhichMenu == OPT_PC || + (!(pSolarSysState->pOrbitalDesc->data_index & PLANET_SHIELDED) && pSolarSysState->SysInfo.PlanetInfo.AtmoDensity != - GAS_GIANT_ATMOSPHERE) + GAS_GIANT_ATMOSPHERE)) DoMenuChooser (pMS, PM_MIN_SCAN); return (TRUE); @@ -1200,9 +1219,10 @@ ScanSystem (void) } } - if ((pSolarSysState->pOrbitalDesc->data_index & PLANET_SHIELDED) + if (optWhichMenu == OPT_3DO && + ((pSolarSysState->pOrbitalDesc->data_index & PLANET_SHIELDED) || pSolarSysState->SysInfo.PlanetInfo.AtmoDensity == - GAS_GIANT_ATMOSPHERE) + GAS_GIANT_ATMOSPHERE)) { MenuState.CurState = EXIT_SCAN; ScanContext = 0;