Little Alien

Automatic reload
- Bug fix: reload from sector inventory only when no enemy in sector
- When in turn based mode make fast reload for the weapon in hands
- When in real time mode reload all weapons with magazines from soldier inventory

Rearrange sector inventory
- Bug fix: rearrange sector inventory only when no enemy in sector



git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@76 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
lalien
2006-05-21 12:25:22 +00:00
parent 30710d5228
commit 2134a20d9d
3 changed files with 54 additions and 12 deletions
+2 -2
View File
@@ -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" };
+2 -2
View File
@@ -43,7 +43,7 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libexpatMT.lib mss32.lib winmm.lib smackw32.lib fmodvc.lib"
OutputFile="C:\games\Jagged Alliance 2 v1.13\ja2_debug_2006_05_20.exe"
OutputFile="C:\games\Jagged Alliance 2 v1.13\ja2_debug_v1.13.76_2006_05_21.exe"
LinkIncremental="2"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories=".\..\..\Standard Gaming Platform\"
@@ -546,7 +546,7 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libexpatMT.lib winmm.lib smackw32.lib mss32.lib fmodvc.lib"
OutputFile="C:\Games\Jagged Alliance 2 v1.13\ja2_release_2006_05_20.exe"
OutputFile="C:\Games\Jagged Alliance 2 v1.13\ja2_release_v1.13.76_2006_05_21.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories=".\..\..\Standard Gaming Platform\"
+50 -8
View File
@@ -3088,7 +3088,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
// Make auto reload with magazines from sector inventory
case 'R':
if (! (gTacticalStatus.uiFlags & INCOMBAT) )
if (! ( gTacticalStatus.fEnemyInSector ) )
{
SOLDIERTYPE *pTeamSoldier;
INT8 bLoop;
@@ -3145,7 +3145,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
{
SOLDIERTYPE *pTeamSoldier;
INT8 bLoop;
OBJECTTYPE *pGun;
OBJECTTYPE *pGun, *pAmmo;
for (bLoop=gTacticalStatus.Team[gbPlayerNum].bFirstID, pTeamSoldier=MercPtrs[bLoop]; bLoop <= gTacticalStatus.Team[gbPlayerNum].bLastID; bLoop++, pTeamSoldier++)
{
@@ -3153,13 +3153,55 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
{
if ( (Item[pTeamSoldier->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++ )
{