mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
New feature: guns can now be fed externally
- a machinegun can be fed by another emc if he has an ammo blet in his hands - a merc can also feed his gun with ammo belts in his inventory - the necessary tags can be set in Items.xml in the <ItemFlag> -tag - this feature can be turned on and off via the JA2_Options.iniReader - for more info, see http://www.bears-pit.com/board/ubbthreads.php/topics/307574/New_feature_Externally_fed_mac.html#Post307574 - this feature requires the newest GameDir files, as a new face icon was added git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5415 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+20
-4
@@ -2464,11 +2464,27 @@ void DeductAmmo( SOLDIERTYPE *pSoldier, INT8 bInvPos )
|
||||
// Flugente: check for underbarrel weapons and use that object if necessary
|
||||
OBJECTTYPE* pObjUsed = pSoldier->GetUsedWeapon( &(pSoldier->inv[bInvPos]) );
|
||||
|
||||
// OK, let's see, don't overrun...
|
||||
if ( (*pObjUsed)[0]->data.gun.ubGunShotsLeft != 0 )
|
||||
// Flugente: external feeding allows us to take ammo from somewhere other than our magazine, like a belt in our inventory our even another mercs
|
||||
if ( gGameExternalOptions.ubExternalFeeding > 0 )
|
||||
{
|
||||
(*pObjUsed)[0]->data.gun.ubGunShotsLeft--;
|
||||
}
|
||||
if ( !DeductBulletViaExternalFeeding(pSoldier, pObj) )
|
||||
{
|
||||
// bullet couldn't be fed externally -> remove bullet from the weapon's magazine
|
||||
// OK, let's see, don't overrun...
|
||||
if ( (*pObjUsed)[0]->data.gun.ubGunShotsLeft != 0 )
|
||||
{
|
||||
(*pObjUsed)[0]->data.gun.ubGunShotsLeft--;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// OK, let's see, don't overrun...
|
||||
if ( (*pObjUsed)[0]->data.gun.ubGunShotsLeft != 0 )
|
||||
{
|
||||
(*pObjUsed)[0]->data.gun.ubGunShotsLeft--;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( Item[ pObj->usItem ].usItemClass == IC_LAUNCHER || Item[pObj->usItem].cannon || pSoldier->bWeaponMode == WM_ATTACHED_GL || pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST || pSoldier->bWeaponMode == WM_ATTACHED_GL_AUTO )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user