diff --git a/Tactical/Rotting Corpses.cpp b/Tactical/Rotting Corpses.cpp index 321edae4..a15ced57 100644 --- a/Tactical/Rotting Corpses.cpp +++ b/Tactical/Rotting Corpses.cpp @@ -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 diff --git a/Tactical/Weapons.cpp b/Tactical/Weapons.cpp index 94a8ceca..2666e14e 100644 --- a/Tactical/Weapons.cpp +++ b/Tactical/Weapons.cpp @@ -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 ) {