Forbid ammo with tracer effects to be used by AI on singleshot-only guns

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6293 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2013-08-18 22:40:33 +00:00
parent 2852b33ac9
commit 4b0094902a
+19 -2
View File
@@ -7318,8 +7318,18 @@ UINT16 DefaultMagazine( UINT16 usItem )
Magazine[usLoop].ubMagSize == pWeapon->ubMagSize &&
AmmoTypes[ Magazine[usLoop].ubAmmoType ].standardIssue )
{
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("DefaultMagazine: found at index %d",usLoop));
return(MagazineClassIndexToItemType(usLoop));
// Flugente: forbid ammo with tracer effects to be used on singleshot-only guns (snipers wouldn't use ammo that marks their position, would they?)
if ( !pWeapon->ubShotsPerBurst && !pWeapon->bAutofireShotsPerFiveAP && AmmoTypes[ Magazine[usLoop].ubAmmoType ].tracerEffect )
{
// don't use this one...
usLoop++;
continue;
}
else
{
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("DefaultMagazine: found at index %d",usLoop));
return(MagazineClassIndexToItemType(usLoop));
}
}
usLoop++;
@@ -7515,6 +7525,13 @@ UINT16 RandomMagazine( OBJECTTYPE * pGun, UINT8 ubPercentStandard, UINT8 maxCool
{
if ( gArmyItemChoices[bSoldierClass][ENEMYAMMOTYPES].bItemNo[i] == Magazine[usLoop].ubAmmoType )
{
// Flugente: forbid ammo with tracer effects to be used on singleshot-only guns (snipers wouldn't use ammo that marks their position, would they?)
if ( !pWeapon->ubShotsPerBurst && !pWeapon->bAutofireShotsPerFiveAP && AmmoTypes[ Magazine[usLoop].ubAmmoType ].tracerEffect )
{
// don't use this one...
continue;
}
usPossibleMagIndex[usPossibleMagCnt++] = usLoop;
break;
}