mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
FindAmmoToReload: added assert messages to indicate that searching attached weapon failed.
DecideAction: initialize bWeaponMode = WM_NORMAL to prevent FindAmmoToReload from crashing. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8892 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+10
-7
@@ -3804,19 +3804,22 @@ INT8 FindAmmoToReload( SOLDIERTYPE * pSoldier, INT8 bWeaponIn, INT8 bExcludeSlot
|
||||
{
|
||||
return( NO_SLOT );
|
||||
}
|
||||
if(pSoldier->bWeaponMode == WM_ATTACHED_GL || pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST || pSoldier->bWeaponMode == WM_ATTACHED_GL_AUTO)//dnl ch63 230813
|
||||
|
||||
if (pSoldier->bWeaponMode == WM_ATTACHED_GL || pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST || pSoldier->bWeaponMode == WM_ATTACHED_GL_AUTO)//dnl ch63 230813
|
||||
{
|
||||
pObj = FindAttachment_GrenadeLauncher(&pSoldier->inv[bWeaponIn]);
|
||||
AssertMsg(pObj, "FindAmmoToReload: could not find attached grenade launcher.");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Flugente: check for underbarrel weapons and use that object if necessary
|
||||
pObj = pSoldier->GetUsedWeapon( &(pSoldier->inv[bWeaponIn]) );
|
||||
// Flugente: check for underbarrel weapons and use that object if necessary
|
||||
pObj = pSoldier->GetUsedWeapon(&(pSoldier->inv[bWeaponIn]));
|
||||
AssertMsg(pObj, "FindAmmoToReload: could not find underbarrel weapon.");
|
||||
|
||||
//<SB> manual recharge
|
||||
if ((*pObj)[0]->data.gun.ubGunShotsLeft && !((*pObj)[0]->data.gun.ubGunState & GS_CARTRIDGE_IN_CHAMBER) )
|
||||
return bWeaponIn;
|
||||
//</SB>
|
||||
//<SB> manual recharge
|
||||
if ((*pObj)[0]->data.gun.ubGunShotsLeft && !((*pObj)[0]->data.gun.ubGunState & GS_CARTRIDGE_IN_CHAMBER))
|
||||
return bWeaponIn;
|
||||
//</SB>
|
||||
}
|
||||
if ( Item[pObj->usItem].usItemClass == IC_GUN && !Item[pObj->usItem].cannon )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user