diff --git a/GameVersion.cpp b/GameVersion.cpp index d85bc0bcb..a65e8b484 100644 --- a/GameVersion.cpp +++ b/GameVersion.cpp @@ -13,12 +13,12 @@ #ifdef JA2EDITOR //MAP EDITOR BUILD VERSION -CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.2039" }; +CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.20469" }; #elif defined JA2BETAVERSION //BETA/TEST BUILD VERSION -CHAR16 zVersionLabel[256] = { L"Debug v1.13.2039" }; +CHAR16 zVersionLabel[256] = { L"Debug v1.13.2046" }; #elif defined CRIPPLED_VERSION @@ -28,11 +28,11 @@ CHAR16 zVersionLabel[256] = { L"Beta v. 0.98" }; #else //RELEASE BUILD VERSION - CHAR16 zVersionLabel[256] = { L"Release v1.13.2039" }; + CHAR16 zVersionLabel[256] = { L"Release v1.13.2046" }; #endif -CHAR8 czVersionNumber[16] = { "Build 08.04.17" }; //YY.MM.DD +CHAR8 czVersionNumber[16] = { "Build 08.04.18" }; //YY.MM.DD CHAR16 zTrackingNumber[16] = { L"Z" }; diff --git a/Strategic/Map Screen Interface Map Inventory.cpp b/Strategic/Map Screen Interface Map Inventory.cpp index 238de6e76..2bf8f1e77 100644 --- a/Strategic/Map Screen Interface Map Inventory.cpp +++ b/Strategic/Map Screen Interface Map Inventory.cpp @@ -833,7 +833,7 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason ) fShowInventoryFlag = TRUE; MAPInternalInitItemDescriptionBox( &twItem->object, 0, 0 ); } - else if(gpItemPointer == NULL || gpItemPointer->usItem == twItem->object.usItem || ValidAttachment(gpItemPointer->usItem, twItem->object.usItem) == TRUE) + else if(gpItemPointer == NULL || gpItemPointer->usItem == twItem->object.usItem || ValidAttachment(gpItemPointer->usItem, twItem->object.usItem) == TRUE || ValidAmmoType(twItem->object.usItem, gpItemPointer->usItem) == TRUE) { InitSectorStackPopup( twItem, iCounter, 0, INV_REGION_Y, 261, ( SCREEN_HEIGHT - PLAYER_INFO_Y ) ); fTeamPanelDirty=TRUE; diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index 9833eab70..da38c04a7 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -2850,6 +2850,11 @@ BOOLEAN ReloadGun( SOLDIERTYPE * pSoldier, OBJECTTYPE * pGun, OBJECTTYPE * pAmmo bAPs = 0; + //CHRISL: If we enter here from the sector inventory panel, we won't have soldier info. So setup a blank soldier to + // avoid a crash later in the code. + if(pSoldier == NULL) + pSoldier = new SOLDIERTYPE; + if ( (gTacticalStatus.uiFlags & TURNBASED) && (gTacticalStatus.uiFlags & INCOMBAT) ) { //CHRISL: Alter this so we treat clip fed weapons differently from weapons that load with loose rounds @@ -2926,6 +2931,12 @@ BOOLEAN ReloadGun( SOLDIERTYPE * pSoldier, OBJECTTYPE * pGun, OBJECTTYPE * pAmmo } } + //CHRISL: We need to verify that the passed subObject actually exists. We could get passed an empty subObject if we + // reload a stack of weapons from the stack popup. If this is the case, reset subObject to the last item in the + // stack + if(subObject >= pGun->ubNumberOfObjects) + subObject = ammoObject = pGun->ubNumberOfObjects-1; + //CHRISL: If reloading with a stack, we probably want the item with the most ammo still in it if (fReloadingWithStack) { diff --git a/ja2_2005Express.vcproj b/ja2_2005Express.vcproj index d6f1fe0a2..89bf4e060 100644 --- a/ja2_2005Express.vcproj +++ b/ja2_2005Express.vcproj @@ -66,7 +66,7 @@