mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
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:
+19
-2
@@ -7318,8 +7318,18 @@ UINT16 DefaultMagazine( UINT16 usItem )
|
|||||||
Magazine[usLoop].ubMagSize == pWeapon->ubMagSize &&
|
Magazine[usLoop].ubMagSize == pWeapon->ubMagSize &&
|
||||||
AmmoTypes[ Magazine[usLoop].ubAmmoType ].standardIssue )
|
AmmoTypes[ Magazine[usLoop].ubAmmoType ].standardIssue )
|
||||||
{
|
{
|
||||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("DefaultMagazine: found at index %d",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?)
|
||||||
return(MagazineClassIndexToItemType(usLoop));
|
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++;
|
usLoop++;
|
||||||
@@ -7515,6 +7525,13 @@ UINT16 RandomMagazine( OBJECTTYPE * pGun, UINT8 ubPercentStandard, UINT8 maxCool
|
|||||||
{
|
{
|
||||||
if ( gArmyItemChoices[bSoldierClass][ENEMYAMMOTYPES].bItemNo[i] == Magazine[usLoop].ubAmmoType )
|
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;
|
usPossibleMagIndex[usPossibleMagCnt++] = usLoop;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user