mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Fixed a potential crash when a merc dies.
Finally fixed CalcMaxTossRange so that it pulls the correct grenade launcher item instead of just the first one, thereby allowing more than one range value per set of launcher items that launch the same grenades. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5211 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -566,7 +566,7 @@ INT32 AddRottingCorpse( ROTTING_CORPSE_DEFINITION *pCorpseDef )
|
||||
if ( pCorpse->pAniTile == NULL )
|
||||
{
|
||||
pCorpse->fActivated = FALSE;
|
||||
return( -1 );
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
// Set flag and index values
|
||||
|
||||
+17
-1
@@ -10325,7 +10325,23 @@ INT32 CalcMaxTossRange( SOLDIERTYPE * pSoldier, UINT16 usItem, BOOLEAN fArmed )
|
||||
|
||||
// if item's fired mechanically
|
||||
// ATE: If we are sent in a LAUNCHABLE, get the LAUCNHER, and sub ONLY if we are armed...
|
||||
usSubItem = GetLauncherFromLaunchable( usItem );
|
||||
//MM: this only works if every launcher for a given launchable has the same range!!
|
||||
//usSubItem = GetLauncherFromLaunchable( usItem );
|
||||
//MM: So instead, let's look at the soldier's hand, and check his gun for an underbarrel GL
|
||||
if ( fArmed )
|
||||
{
|
||||
OBJECTTYPE *pObj = NULL;
|
||||
pObj = pSoldier->GetUsedWeapon( &pSoldier->inv[pSoldier->ubAttackingHand] );
|
||||
if ( pObj != NULL )
|
||||
{
|
||||
if (Item[pObj->usItem].usItemClass == IC_LAUNCHER)
|
||||
usSubItem = pObj->usItem;
|
||||
else if (Item[pObj->usItem].usItemClass == IC_GUN)
|
||||
{
|
||||
usSubItem = GetAttachedGrenadeLauncher(pObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( fArmed && usSubItem != NOTHING )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user