From 5197ef21e5753a3c39cf3f6118fba01f9289de69 Mon Sep 17 00:00:00 2001 From: Asdow <20314541+Asdow@users.noreply.github.com> Date: Mon, 10 Oct 2022 07:45:20 +0300 Subject: [PATCH] r9402: Fixed nullptr dereference & assertion error https://github.com/1dot13/source/issues/3#issue-1400794531 https://github.com/1dot13/source/issues/2#issue-1400794162 --- GameVersion.cpp | 4 ++-- Strategic/Map Screen Interface.cpp | 5 ++--- Strategic/strategicmap.cpp | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/GameVersion.cpp b/GameVersion.cpp index 6ebbab93..5d08d501 100644 --- a/GameVersion.cpp +++ b/GameVersion.cpp @@ -55,8 +55,8 @@ #endif -CHAR8 czVersionNumber[16] = { "Build 21.07.13" }; //YY.MM.DD +CHAR8 czVersionNumber[16] = { "Build 10.10.22" }; //YY.MM.DD CHAR16 zTrackingNumber[16] = { L"Z" }; -CHAR16 zRevisionNumber[16] = { L"Revision 9141" }; +CHAR16 zRevisionNumber[16] = { L"Revision 9402" }; // SAVE_GAME_VERSION is defined in header, change it there diff --git a/Strategic/Map Screen Interface.cpp b/Strategic/Map Screen Interface.cpp index a36582c1..40974757 100644 --- a/Strategic/Map Screen Interface.cpp +++ b/Strategic/Map Screen Interface.cpp @@ -6731,11 +6731,10 @@ void TurnOnSectorLocator( UINT8 ubProfileID ) if ( ( ubProfileID == SKYRIDER ) && fSkyRiderSetUp ) { // if helicopter position is being shown, don't do this, too, cause the helicopter icon is on top and it looks - // like crap. I tried moving the heli icon blit to before, but that screws up it's blitting. - if ( gusMapDisplayColourMode != MAP_DISPLAY_AIRSPACE && gusMapDisplayColourMode != MAP_DISPLAY_AIRSPACE_COLOURED_SAMS ) + // like crap. I tried moving the heli icon blit to before, but that screws up it's blitting. + if ( gusMapDisplayColourMode != MAP_DISPLAY_AIRSPACE && gusMapDisplayColourMode != MAP_DISPLAY_AIRSPACE_COLOURED_SAMS && iHelicopterVehicleId != -1 ) { // can't use his profile, he's where his chopper is - Assert( iHelicopterVehicleId != -1 ); gsSectorLocatorX = pVehicleList[ iHelicopterVehicleId ].sSectorX; gsSectorLocatorY = pVehicleList[ iHelicopterVehicleId ].sSectorY; } diff --git a/Strategic/strategicmap.cpp b/Strategic/strategicmap.cpp index c1db7249..03a881c7 100644 --- a/Strategic/strategicmap.cpp +++ b/Strategic/strategicmap.cpp @@ -4937,9 +4937,8 @@ BOOLEAN OKForSectorExit( INT8 bExitDirection, INT32 usAdditionalData, UINT32 *pu for ( pSoldier = MercPtrs[cnt]; cnt <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++cnt, ++pSoldier ) { // If we are controllable - //if ( OK_CONTROLLABLE_MERC( pSoldier) && pSoldier->bAssignment == CurrentSquad( ) ) if ( OK_CONTROLLABLE_MERC( pSoldier ) && (pSoldier->bAssignment == CurrentSquad( ) || - (pSoldier->bAssignment == VEHICLE && GetSoldierStructureForVehicle( pSoldier->iVehicleId )->bAssignment == CurrentSquad( ))) ) + (pSoldier->bAssignment == VEHICLE && pSoldier->iVehicleId != iHelicopterVehicleId && GetSoldierStructureForVehicle( pSoldier->iVehicleId )->bAssignment == CurrentSquad( ))) ) { //Need to keep a copy of a good soldier, so we can access it later, and //not more than once.