From eeb82168b531d5b5f1a4b12f1d931bb8fbf3dece Mon Sep 17 00:00:00 2001 From: Overhaul Date: Sat, 20 Oct 2007 07:13:44 +0000 Subject: [PATCH] Fixed update of items for which auto/burst does not apply when swapped into the hand Moved helicopter in Estoni so that it is unblocked by a weed and can therefore appear completely Fixed conditions where the game should remain paused but doesn't, and where it should unpause but doesn't git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1531 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/Assignments.cpp | 10 ++++++---- Strategic/Campaign Types.h | 6 +++--- Strategic/Map Screen Helicopter.cpp | 5 ++++- Strategic/Merc Contract.cpp | 8 ++++++-- Strategic/Player Command.cpp | 1 + Strategic/strategicmap.cpp | 10 +++++----- 6 files changed, 25 insertions(+), 15 deletions(-) diff --git a/Strategic/Assignments.cpp b/Strategic/Assignments.cpp index f95fedc69..aa26f099e 100644 --- a/Strategic/Assignments.cpp +++ b/Strategic/Assignments.cpp @@ -5491,7 +5491,7 @@ void MakeSureToolKitIsInHand( SOLDIERTYPE *pSoldier ) { if( Item[pSoldier -> inv[ bPocket ].usItem].toolkit ) { - SwapObjs( &pSoldier -> inv[ HANDPOS ], &pSoldier -> inv[ bPocket ] ); + SwapObjs( pSoldier, HANDPOS, bPocket ); break; } } @@ -5519,7 +5519,7 @@ BOOLEAN MakeSureMedKitIsInHand( SOLDIERTYPE *pSoldier ) if ( Item[pSoldier -> inv[ bPocket ].usItem].medicalkit ) { fCharacterInfoPanelDirty = TRUE; - SwapObjs( &pSoldier -> inv[ HANDPOS ], &pSoldier -> inv[ bPocket ] ); + SwapObjs( pSoldier, HANDPOS, bPocket ); return(TRUE); } } @@ -5539,14 +5539,14 @@ BOOLEAN MakeSureMedKitIsInHand( SOLDIERTYPE *pSoldier ) if( ( Item[ pSoldier -> inv[ HANDPOS ].usItem ].twohanded ) && ( bPocket >= SMALLPOCK1POS ) ) { // first move from hand to second hand - SwapObjs( &pSoldier -> inv[ HANDPOS ], &pSoldier -> inv[ SECONDHANDPOS ] ); + SwapObjs( pSoldier, HANDPOS, SECONDHANDPOS ); // dirty mapscreen and squad panels fCharacterInfoPanelDirty = TRUE; fInterfacePanelDirty = DIRTYLEVEL2; } - SwapObjs( &pSoldier -> inv[ HANDPOS ], &pSoldier -> inv[ bPocket ] ); + SwapObjs( pSoldier, HANDPOS, bPocket ); return(TRUE); @@ -7084,6 +7084,8 @@ void ContractMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason ) } else { + // The game should be unpaused when this message box disappears + UnPauseGame(); DoMapMessageBox( MSG_BOX_BASIC_STYLE, gzLateLocalizedString[ 48 ], MAP_SCREEN, MSG_BOX_FLAG_YESNO, MercDismissConfirmCallBack ); } diff --git a/Strategic/Campaign Types.h b/Strategic/Campaign Types.h index 21ee52ffe..4baa39b08 100644 --- a/Strategic/Campaign Types.h +++ b/Strategic/Campaign Types.h @@ -4,9 +4,9 @@ #include "types.h" //Macro to convert sector coordinates (1-16,1-16) to 0-255 -#define SECTOR(x,y) ((y-1)*16+x-1) -#define SECTORX(SectorID) ((SectorID % 16) + 1) -#define SECTORY(SectorID) ((SectorID / 16) + 1) +#define SECTOR(x,y) (UINT8)((y-1)*16+x-1) +#define SECTORX(SectorID) (UINT8)((SectorID % 16) + 1) +#define SECTORY(SectorID) (UINT8)((SectorID / 16) + 1) //Sector enumerations // diff --git a/Strategic/Map Screen Helicopter.cpp b/Strategic/Map Screen Helicopter.cpp index e330b3494..3b8ca1ef3 100644 --- a/Strategic/Map Screen Helicopter.cpp +++ b/Strategic/Map Screen Helicopter.cpp @@ -117,7 +117,7 @@ UINT8 ubRefuelList[ NUMBER_OF_REFUEL_SITES ][ 2 ] = INT16 sRefuelStartGridNo[ NUMBER_OF_REFUEL_SITES ] ={ 9001, // drassen - 13068, // estoni + 13067, // estoni }; // whether or not helicopter can refuel at this site @@ -1566,6 +1566,9 @@ void HandleHelicopterOnGroundGraphic( void ) { gMercProfiles[ SKYRIDER ].sSectorX = gWorldSectorX; gMercProfiles[ SKYRIDER ].sSectorY = gWorldSectorY; + gMercProfiles[ SKYRIDER ].ubStrategicInsertionCode = INSERTION_CODE_GRIDNO; + gMercProfiles[ SKYRIDER ].usStrategicInsertionData = sRefuelStartGridNo[ubSite] - 639; // Stand near the heli + gMercProfiles[ SKYRIDER ].fUseProfileInsertionInfo = TRUE; } } else diff --git a/Strategic/Merc Contract.cpp b/Strategic/Merc Contract.cpp index 1f3f18301..d849d3d9f 100644 --- a/Strategic/Merc Contract.cpp +++ b/Strategic/Merc Contract.cpp @@ -980,8 +980,12 @@ BOOLEAN StrategicRemoveMerc( SOLDIERTYPE *pSoldier ) wcsncpy( gMercProfiles[ pSoldier->ubProfile ].zName, L"", 1 ); } - // ATE: update team panels.... - UpdateTeamPanelAssignments( ); + // ATE: update team panels.... + UpdateTeamPanelAssignments( ); + + // And unpause the @#$@#$ interface + UnLockPauseState(); + UnPauseGame(); return( TRUE ); } diff --git a/Strategic/Player Command.cpp b/Strategic/Player Command.cpp index 652769cc6..adeb7905f 100644 --- a/Strategic/Player Command.cpp +++ b/Strategic/Player Command.cpp @@ -415,6 +415,7 @@ void ClearMapControlledFlags( void ) SectorInfo[ SECTOR( iCounterA, iCounterB ) ].fPlayer[ 0 ] = TRUE; } } + UpdateAirspaceControl( ); } #endif diff --git a/Strategic/strategicmap.cpp b/Strategic/strategicmap.cpp index bcdc1c4d7..a2c66f262 100644 --- a/Strategic/strategicmap.cpp +++ b/Strategic/strategicmap.cpp @@ -4476,10 +4476,10 @@ BOOLEAN IsThisSectorASAMSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ ) return( FALSE ); } - for ( cnt = 0; cnt < NUMBER_OF_SAMS; cnt++ ) - { - if( ( sSectorX == gpSamSectorX[cnt] ) && ( sSectorY == gpSamSectorY[cnt] ) ) - return( TRUE ); + for ( cnt = 0; cnt < NUMBER_OF_SAMS; cnt++ ) + { + if( ( sSectorX == gpSamSectorX[cnt] ) && ( sSectorY == gpSamSectorY[cnt] ) ) + return( TRUE ); } return ( FALSE ); @@ -4871,7 +4871,7 @@ void AdjustSoldierPathToGoOffEdge( SOLDIERTYPE *pSoldier, INT16 sEndGridNo, UINT for (iLoop = 0; iLoop < pSoldier->usPathDataSize; iLoop++) { - sTempGridNo += (INT16)DirectionInc( pSoldier->usPathingData[ iLoop ] ); + sTempGridNo += DirectionInc( (UINT8) pSoldier->usPathingData[ iLoop ] ); } if (sTempGridNo == sEndGridNo)