diff --git a/GameVersion.cpp b/GameVersion.cpp index d60ceecf..4f8a80d1 100644 --- a/GameVersion.cpp +++ b/GameVersion.cpp @@ -23,12 +23,12 @@ INT16 zVersionLabel[256] = { L"Beta v. 0.98" }; #else //RELEASE BUILD VERSION - INT16 zVersionLabel[256] = { L"Release v1.13.71 2006.05.18" }; + INT16 zVersionLabel[256] = { L"Release v1.13.76 2006.05.21" }; #endif -INT8 czVersionNumber[16] = { "Build 06.05.20" }; +INT8 czVersionNumber[16] = { "Build 06.05.21" }; INT16 zTrackingNumber[16] = { L"Z" }; diff --git a/JA2.vcproj b/JA2.vcproj index 792ffbf0..7d13e239 100644 --- a/JA2.vcproj +++ b/JA2.vcproj @@ -43,7 +43,7 @@ inv[HANDPOS].usItem].usItemClass & IC_GUN) || (Item[pTeamSoldier->inv[HANDPOS].usItem].usItemClass == IC_LAUNCHER) ) { - pGun = &(pTeamSoldier->inv[HANDPOS]); - - //magazine is not full - if ( pGun->ubGunShotsLeft < GetMagSize( pGun ) ) + if ( ( gTacticalStatus.uiFlags & INCOMBAT ) ) { - AutoReload( pTeamSoldier ); + pGun = &(pTeamSoldier->inv[HANDPOS]); + + //magazine is not full + if ( pGun->ubGunShotsLeft < GetMagSize( pGun ) ) + { + AutoReload( pTeamSoldier ); + } } + else + { + // Search for gun in soldier inventory + for (UINT32 bLoop2 = 0; bLoop2 < NUM_INV_SLOTS; bLoop2++) + { + if ( (Item[pTeamSoldier->inv[bLoop2].usItem].usItemClass & IC_GUN) || (Item[pTeamSoldier->inv[bLoop2].usItem].usItemClass == IC_LAUNCHER) ) + { + pGun = &(pTeamSoldier->inv[bLoop2]); + //if magazine is not full + if ( pGun->ubGunShotsLeft < GetMagSize( pGun ) ) + { + + // Search for ammo in soldier inventory + for ( UINT32 uiLoop = 0; uiLoop < NUM_INV_SLOTS; uiLoop++ ) + { + if ( (Item[pTeamSoldier->inv[uiLoop].usItem].usItemClass & IC_AMMO ) ) // the item is ammo + { + pAmmo = &(pTeamSoldier->inv[uiLoop]); + + if ( CompatibleAmmoForGun( pAmmo, pGun ) ) // can use the ammo with this gun + { + // same ammo type in gun and magazine + if ( Magazine[Item[pGun->usGunAmmoItem].ubClassIndex].ubAmmoType == Magazine[Item[pAmmo->usItem].ubClassIndex].ubAmmoType ) + { + ReloadGun( pTeamSoldier, pGun, pAmmo ); + + fCharacterInfoPanelDirty = TRUE; + fInterfacePanelDirty = DIRTYLEVEL2; + } + } + } + } + } + } + } + + + } + } } } @@ -3210,7 +3252,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent ) case 'S': - if (! (gTacticalStatus.uiFlags & INCOMBAT) ) + if (! ( gTacticalStatus.fEnemyInSector ) ) { for ( UINT32 uiLoop = 0; uiLoop < guiNumWorldItems; uiLoop++ ) {