New Attachment: the rifle grenade device (<AttachmentClass>33554432</AttachmentClass>) acts as a GL on the barrel slot, but blocks all other firing modes, and uses up one bullet.

It is strongly advised not to use this in combination with other underbarrel GLs.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5537 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2012-08-26 18:59:37 +00:00
parent 3dbdd4b2ad
commit 2ebe96ca59
5 changed files with 162 additions and 31 deletions
+10
View File
@@ -2632,6 +2632,16 @@ UINT8 GetActionModeCursor( SOLDIERTYPE *pSoldier )
if ( pSoldier->bWeaponMode == WM_ATTACHED_GL )
{
// Flugente: if using a rifle grenade, only allow firing if there is a bullet in the gun's magazine (required for firing)
if ( HasAttachmentOfClass( &(pSoldier->inv[HANDPOS]), AC_RIFLEGRENADE) )
{
OBJECTTYPE* pObj = &(pSoldier->inv[HANDPOS]);
if ( (*pObj)[0]->data.gun.ubGunShotsLeft> 0 )
return( TRAJECTORYCURS );
else
return( INVALIDCURS );
}
return( TRAJECTORYCURS );
}
if ( pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST || ( pSoldier->bWeaponMode == WM_BURST && Item[pSoldier->inv[HANDPOS].usItem].grenadelauncher ) )