Added Common Attachment Framework

-- Known issue -- the BR gun tooltips will double up if an item is using both the old attachment method and the new CAF

& Working files

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5234 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
MaddMugsy
2012-04-28 10:17:59 +00:00
parent 11cc056601
commit dafc7d8bec
10 changed files with 258 additions and 47 deletions
+39 -2
View File
@@ -1903,7 +1903,25 @@ void CalculateLaunchItemBasicParams( SOLDIERTYPE *pSoldier, OBJECTTYPE *pItem, I
// Are we armed, and are we throwing a LAUNCHABLE?
usLauncher = GetLauncherFromLaunchable( pItem->usItem );
//MM: Again, this only works if the launchers are all the same
//usLauncher = GetLauncherFromLaunchable( pItem->usItem );
//MM: Replacement:
OBJECTTYPE *pObj = NULL;
usLauncher = 0;
pObj = pSoldier->GetUsedWeapon( &pSoldier->inv[pSoldier->ubAttackingHand] );
if ( pObj != NULL )
{
if (Item[pObj->usItem].usItemClass == IC_LAUNCHER)
usLauncher = pObj->usItem;
else if (Item[pObj->usItem].usItemClass == IC_GUN)
{
usLauncher = GetAttachedGrenadeLauncher(pObj);
}
}
if ( usLauncher == 0) // fail back to the original
usLauncher = GetLauncherFromLaunchable( pItem->usItem );
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("physics.cpp line 1741"));
if ( fArmed && ( Item[usLauncher].mortar || Item[pItem->usItem].mortar ) )
{
@@ -2304,7 +2322,26 @@ void CalculateLaunchItemParamsForThrow( SOLDIERTYPE *pSoldier, INT32 sGridNo, UI
sStartZ = GET_SOLDIER_THROW_HEIGHT( pSoldier->pathing.bLevel );
usLauncher = GetLauncherFromLaunchable( pItem->usItem );
//MM: Again, this only works if the launchers are all the same
//usLauncher = GetLauncherFromLaunchable( pItem->usItem );
//MM: Replacement:
OBJECTTYPE *pObj = NULL;
usLauncher = 0;
pObj = pSoldier->GetUsedWeapon( &pSoldier->inv[pSoldier->ubAttackingHand] );
if ( pObj != NULL )
{
if (Item[pObj->usItem].usItemClass == IC_LAUNCHER)
usLauncher = pObj->usItem;
else if (Item[pObj->usItem].usItemClass == IC_GUN)
{
usLauncher = GetAttachedGrenadeLauncher(pObj);
}
}
if ( usLauncher == 0) // fail back to the original
usLauncher = GetLauncherFromLaunchable( pItem->usItem );
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("physics.cpp line 2103"));
if ( fArmed && Item[usLauncher].mortar )