diff --git a/Laptop/CampaignHistory_Summary.cpp b/Laptop/CampaignHistory_Summary.cpp index 4787e1a7..1ccc8747 100644 --- a/Laptop/CampaignHistory_Summary.cpp +++ b/Laptop/CampaignHistory_Summary.cpp @@ -793,9 +793,9 @@ void RenderCampaignHistory_MostImportant() UINT16 armysize = max(1, incident.usParticipants[CAMPAIGNHISTORY_SD_ENEMY_ADMIN] + incident.usParticipants[CAMPAIGNHISTORY_SD_ENEMY_ARMY] + incident.usParticipants[CAMPAIGNHISTORY_SD_ENEMY_ELITE] + incident.usParticipants[CAMPAIGNHISTORY_SD_ENEMY_TANK]); // if rebels won... - if ( incident.usIncidentFlags & INCIDENT_WIN ) + if ( incident.usIncidentFlags & INCIDENT_WIN && rebelsize ) { - FLOAT ratio = (FLOAT)(rebellosses / rebelsize); + FLOAT ratio = (FLOAT)(rebellosses) / (FLOAT)(rebelsize); if ( ratio < 0.1 ) swprintf(sText, szCampaignHistoryResultString[TEXT_CAMPAIGNHISTORY_RESULT_ONESIDED_REBEL] ); else if ( ratio < 0.3 ) @@ -815,9 +815,9 @@ void RenderCampaignHistory_MostImportant() else swprintf(sText, szCampaignHistoryResultString[TEXT_CAMPAIGNHISTORY_RESULT_HARD_REBEL] ); } - else // army won... + else if ( armysize ) // army won... { - FLOAT ratio = (FLOAT)(armylosses / armysize); + FLOAT ratio = (FLOAT)(armylosses) / (FLOAT)(armysize); BOOLEAN armyhadmore = (armysize > rebelsize); if ( ratio < 0.1 ) diff --git a/Strategic/Map Screen Helicopter.cpp b/Strategic/Map Screen Helicopter.cpp index e013718c..b6892485 100644 --- a/Strategic/Map Screen Helicopter.cpp +++ b/Strategic/Map Screen Helicopter.cpp @@ -1661,7 +1661,7 @@ UINT8 MoveAllInHelicopterToFootMovementGroup( INT8 bNewSquad ) } // go through list of everyone in helicopter - for( iCounter = 0; iCounter < gNewVehicle[ pVehicleList[ iHelicopterVehicleId ].ubVehicleType ].iNewSeatingCapacities; iCounter++ ) + for( iCounter = 0; iCounter < gNewVehicle[ pVehicleList[ iHelicopterVehicleId ].ubVehicleType ].iNewSeatingCapacities; ++iCounter ) { // get passenger pSoldier = pVehicleList[ iHelicopterVehicleId ].pPassengers[ iCounter ]; diff --git a/Tactical/Merc Entering.cpp b/Tactical/Merc Entering.cpp index c49b3009..d1c029ee 100644 --- a/Tactical/Merc Entering.cpp +++ b/Tactical/Merc Entering.cpp @@ -672,6 +672,10 @@ void HandleHeliDrop( ) // OK, Check if we have anybody left to send! if ( gbCurDrop < bEndVal ) { + // Flugente: it is now possible to use airdrops with soldiers after they have arrived in Arulco. In that case, they might have an animation that breaks EVENT_InitNewSoldierAnim prematurely. + // In the worst case, this can cause the game to be unable to finsih the airdrop. For that reason, we set all those soldier to the STANDING aniamtion. + MercPtrs[ gusHeliSeats[ gbCurDrop ] ]->usAnimState = STANDING; + //sWorldX = CenterX( gsGridNoSweetSpot ); //sWorldY = CenterY( gsGridNoSweetSpot ); MercPtrs[ gusHeliSeats[ gbCurDrop ] ]->EVENT_InitNewSoldierAnim( HELIDROP, 0 , FALSE ); diff --git a/gamescreen.cpp b/gamescreen.cpp index e91bfd15..566dcc78 100644 --- a/gamescreen.cpp +++ b/gamescreen.cpp @@ -634,10 +634,14 @@ UINT32 MainGameScreenHandle(void) } #else InternalLocateGridNo( gGameExternalOptions.iInitialMercArrivalLocation, TRUE ); -#endif +#endif + // Flugente: we might have reloaded the game, so we are currently not dropping mercs out of a helicopter + gfIngagedInDrop = FALSE; + // Start heli Run... StartHelicopterRun(); + // Update clock by one so that our DidGameJustStatrt() returns now false for things like LAPTOP, etc... SetGameTimeCompressionLevel( TIME_COMPRESS_X1 ); //UpdateClock( 1 );