Fix for AI seeking climb point in toxic gas

Fix for civilians trying to climb the roof to seek noise
Fix for punching and stabbing
Transparent change: Gave names to anonymous structs in OBJECTTYPE


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1225 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Overhaul
2007-08-18 19:03:20 +00:00
parent 29b883f59d
commit fccef1faea
60 changed files with 921 additions and 887 deletions
+16 -16
View File
@@ -1527,23 +1527,23 @@ void AddObjectToArmsDealerInventory( UINT8 ubArmsDealer, OBJECTTYPE *pObject )
AddItemToArmsDealerInventory( ubArmsDealer, pObject->usItem, &SpclItemInfo, 1 );
// if any GunAmmoItem is specified
if( pObject->usGunAmmoItem != NONE)
if( pObject->ItemData.Gun.usGunAmmoItem != NONE)
{
// if it's regular ammo
if( Item[ pObject->usGunAmmoItem ].usItemClass == IC_AMMO )
if( Item[ pObject->ItemData.Gun.usGunAmmoItem ].usItemClass == IC_AMMO )
{
// and there are some remaining
if ( pObject->ubGunShotsLeft > 0 )
if ( pObject->ItemData.Gun.ubGunShotsLeft > 0 )
{
// add the bullets of its remaining ammo
AddAmmoToArmsDealerInventory( ubArmsDealer, pObject->usGunAmmoItem, pObject->ubGunShotsLeft );
AddAmmoToArmsDealerInventory( ubArmsDealer, pObject->ItemData.Gun.usGunAmmoItem, pObject->ItemData.Gun.ubGunShotsLeft );
}
}
else // assume it's attached ammo (mortar shells, grenades)
{
// add the launchable item (can't be imprinted, or have attachments!)
SetSpecialItemInfoToDefaults( &SpclItemInfo );
SpclItemInfo.bItemCondition = pObject->bGunAmmoStatus;
SpclItemInfo.bItemCondition = pObject->ItemData.Gun.bGunAmmoStatus;
// if the gun it was in was jammed, get rid of the negative status now
if ( SpclItemInfo.bItemCondition < 0 )
@@ -1551,7 +1551,7 @@ void AddObjectToArmsDealerInventory( UINT8 ubArmsDealer, OBJECTTYPE *pObject )
SpclItemInfo.bItemCondition *= -1;
}
AddItemToArmsDealerInventory( ubArmsDealer, pObject->usGunAmmoItem, &SpclItemInfo, 1 );
AddItemToArmsDealerInventory( ubArmsDealer, pObject->ItemData.Gun.usGunAmmoItem, &SpclItemInfo, 1 );
}
}
break;
@@ -1560,7 +1560,7 @@ void AddObjectToArmsDealerInventory( UINT8 ubArmsDealer, OBJECTTYPE *pObject )
// add the contents of each magazine (multiple mags may have vastly different #bullets left)
for ( ubCnt = 0; ubCnt < pObject->ubNumberOfObjects; ubCnt++ )
{
AddAmmoToArmsDealerInventory( ubArmsDealer, pObject->usItem, pObject->ubShotsLeft[ ubCnt ] );
AddAmmoToArmsDealerInventory( ubArmsDealer, pObject->usItem, pObject->ItemData.Ammo.ubShotsLeft[ ubCnt ] );
}
break;
@@ -1568,7 +1568,7 @@ void AddObjectToArmsDealerInventory( UINT8 ubArmsDealer, OBJECTTYPE *pObject )
// add each object seperately (multiple objects may have vastly different statuses, keep any imprintID)
for ( ubCnt = 0; ubCnt < pObject->ubNumberOfObjects; ubCnt++ )
{
SpclItemInfo.bItemCondition = pObject->bStatus[ ubCnt ];
SpclItemInfo.bItemCondition = pObject->ItemData.Generic.bStatus[ ubCnt ];
AddItemToArmsDealerInventory( ubArmsDealer, pObject->usItem, &SpclItemInfo, 1 );
}
break;
@@ -2080,7 +2080,7 @@ void MakeObjectOutOfDealerItems( UINT16 usItemIndex, SPECIAL_ITEM_INFO *pSpclIte
// have to keep track of #bullets in a gun throughout dealer inventory. Without this, players could "reload" guns
// they don't have ammo for by selling them to Tony & buying them right back fully loaded! One could repeat this
// ad nauseum (empty the gun between visits) as a (really expensive) way to get unlimited special ammo like rockets.
pObject->ubGunShotsLeft = 0;
pObject->ItemData.Gun.ubGunShotsLeft = 0;
}
}
@@ -2102,7 +2102,7 @@ void GiveObjectToArmsDealerForRepair( UINT8 ubArmsDealer, OBJECTTYPE *pObject, U
Assert( CanDealerRepairItem( ubArmsDealer, pObject->usItem ) );
// c) Actually damaged, or a rocket rifle (being reset)
Assert( ( pObject->bStatus[ 0 ] < 100 ) || ItemIsARocketRifle( pObject->usItem ) );
Assert( ( pObject->ItemData.Generic.bStatus[ 0 ] < 100 ) || ItemIsARocketRifle( pObject->usItem ) );
/* ARM: Can now repair with removeable attachments still attached...
// d) Already stripped of all *detachable* attachments
@@ -2123,11 +2123,11 @@ void GiveObjectToArmsDealerForRepair( UINT8 ubArmsDealer, OBJECTTYPE *pObject, U
if (Item [ pObject->usItem ].usItemClass == IC_GUN )
{
// if any GunAmmoItem is specified
if( pObject->usGunAmmoItem != NONE)
if( pObject->ItemData.Gun.usGunAmmoItem != NONE)
{
// it better be regular ammo, and empty
Assert( Item[ pObject->usGunAmmoItem ].usItemClass == IC_AMMO );
Assert( pObject->ubGunShotsLeft == 0 );
Assert( Item[ pObject->ItemData.Gun.usGunAmmoItem ].usItemClass == IC_AMMO );
Assert( pObject->ItemData.Gun.ubGunShotsLeft == 0 );
}
}
@@ -2250,7 +2250,7 @@ UINT32 CalculateObjectItemRepairTime( UINT8 ubArmsDealer, OBJECTTYPE *pItemObjec
UINT32 uiRepairTime;
UINT8 ubCnt;
uiRepairTime = CalculateSimpleItemRepairTime( ubArmsDealer, pItemObject->usItem, pItemObject->bStatus[ 0 ] );
uiRepairTime = CalculateSimpleItemRepairTime( ubArmsDealer, pItemObject->usItem, pItemObject->ItemData.Generic.bStatus[ 0 ] );
// add time to repair any attachments on it
for ( ubCnt = 0; ubCnt < MAX_ATTACHMENTS; ubCnt++ )
@@ -2334,7 +2334,7 @@ UINT32 CalculateObjectItemRepairCost( UINT8 ubArmsDealer, OBJECTTYPE *pItemObjec
UINT32 uiRepairCost;
UINT8 ubCnt;
uiRepairCost = CalculateSimpleItemRepairCost( ubArmsDealer, pItemObject->usItem, pItemObject->bStatus[ 0 ] );
uiRepairCost = CalculateSimpleItemRepairCost( ubArmsDealer, pItemObject->usItem, pItemObject->ItemData.Generic.bStatus[ 0 ] );
// add cost of repairing any attachments on it
for ( ubCnt = 0; ubCnt < MAX_ATTACHMENTS; ubCnt++ )
@@ -2435,7 +2435,7 @@ void SetSpecialItemInfoFromObject( SPECIAL_ITEM_INFO *pSpclItemInfo, OBJECTTYPE
}
else
{
pSpclItemInfo->bItemCondition = pObject->bStatus[ 0 ];
pSpclItemInfo->bItemCondition = pObject->ItemData.Generic.bStatus[ 0 ];
}
// only guns currently have imprintID properly initialized...