diff --git a/Strategic/Assignments.cpp b/Strategic/Assignments.cpp index 627be481..d09db2cb 100644 --- a/Strategic/Assignments.cpp +++ b/Strategic/Assignments.cpp @@ -3329,7 +3329,7 @@ BOOL HandleSnitchExposition(SOLDIERTYPE *pSoldier) //pSoldier->SoldierTakeDamage( 0, 0, usDamageTaken, TAKE_DAMAGE_HANDTOHAND, NOBODY, NOWHERE, 0, TRUE ); pSoldier->bBreath = max( 0, pSoldier->bBreath - usDamageTaken ); // he drowned? - if( pSoldier->bBreath = 0 ) + if( pSoldier->bBreath == 0 ) { // dead pSoldier->SoldierTakeDamage( 0, 100, 100, TAKE_DAMAGE_HANDTOHAND, NOBODY, NOWHERE, 0, TRUE ); diff --git a/Strategic/Hourly Update.cpp b/Strategic/Hourly Update.cpp index 3aa33c48..c31ba207 100644 --- a/Strategic/Hourly Update.cpp +++ b/Strategic/Hourly Update.cpp @@ -553,7 +553,7 @@ void HourlySmokerUpdate( ) // anv: decrease exposed snitch cooldown (for simplified exposition handling) void HourlySnitchUpdate() { - for( INT32 cnt = 0; cnt <= NUM_PROFILES; ++cnt ) + for( INT32 cnt = 0; cnt < NUM_PROFILES; ++cnt ) { if( gMercProfiles[cnt].ubSnitchExposedCooldown > 0 ) gMercProfiles[cnt].ubSnitchExposedCooldown--; diff --git a/Strategic/Strategic AI.cpp b/Strategic/Strategic AI.cpp index 1984c007..ed7a7e51 100644 --- a/Strategic/Strategic AI.cpp +++ b/Strategic/Strategic AI.cpp @@ -5984,7 +5984,7 @@ void StrategicHandleQueenLosingControlOfSector( INT16 sSectorX, INT16 sSectorY, if( ubTownId != BLANK_SECTOR && GetTownSectorSize( ubTownId ) != 1 ) { - for( INT32 i = 0; i < MAP_WORLD_X * MAP_WORLD_Y + 1; i++ ) + for( INT32 i = 0; i < MAP_WORLD_X * MAP_WORLD_Y; i++ ) { if( StrategicMap[ i ].bNameId == ubTownId ) SectorInfo[ STRATEGIC_INDEX_TO_SECTOR_INFO( i ) ].ubInvestigativeState++; @@ -6292,7 +6292,7 @@ void StrategicHandleMineThatRanOut( UINT8 ubSectorID ) if( ubTownId != BLANK_SECTOR ) { - for( INT32 i = 0; i < MAP_WORLD_X * MAP_WORLD_Y + 1; i++ ) + for( INT32 i = 0; i < MAP_WORLD_X * MAP_WORLD_Y; i++ ) { if( StrategicMap[ i ].bNameId == ubTownId ) gArmyComp[ gGarrisonGroup[ SectorInfo[ STRATEGIC_INDEX_TO_SECTOR_INFO( i ) ].ubGarrisonID ].ubComposition ].bPriority /= 4; diff --git a/Strategic/mapscreen.cpp b/Strategic/mapscreen.cpp index 9aab3643..f5f71c32 100644 --- a/Strategic/mapscreen.cpp +++ b/Strategic/mapscreen.cpp @@ -14323,10 +14323,12 @@ void RemoveMPButtonsForMapScreen( void ) UnloadButtonImage( giMapMPButtonImage[ iCounter ] ); if(iCounter < MAX_MP_BUTTONS) + { RemoveButton( giMapMPButton[ iCounter ] ); + giMapMPButton[ iCounter ] = -1; + } giMapMPButtonImage[ iCounter ] = -1; - giMapMPButton[ iCounter ] = -1; } return; } diff --git a/Utils/Utilities.cpp b/Utils/Utilities.cpp index 5f1c3e71..8183aca9 100644 --- a/Utils/Utilities.cpp +++ b/Utils/Utilities.cpp @@ -250,7 +250,7 @@ BOOLEAN WrapString( STR16 pStr, STR16 pStr2, UINT16 usWidth, INT32 uiFont ) { //We completed the check for a space, but failed, so use the hyphen method. swprintf( pStr2, L"-%s", &(pStr[uiHyphenLet]) ); - pStr[uiHyphenLet] = (INT16)'/0'; + pStr[uiHyphenLet] = (INT16)'\0'; fLineSplit = TRUE; //hyphen method // HEADROCK HAM 3.6: This is erroneous. At this point, the function should RETURN, otherwise it // cuts another bit off pStr for no reason.