mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
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:
@@ -610,7 +610,7 @@ void GenerateProsString( STR16 zItemPros, OBJECTTYPE * pObject, UINT32 uiPixLimi
|
||||
ubWeight = Item[ usItem ].ubWeight;
|
||||
if (Item[ usItem ].usItemClass == IC_GUN)
|
||||
{
|
||||
ubWeight += Item[ pObject->usGunAmmoItem ].ubWeight;
|
||||
ubWeight += Item[ pObject->ItemData.Gun.usGunAmmoItem ].ubWeight;
|
||||
}
|
||||
|
||||
if (Weapon[usItem].bAccuracy >= EXCEPTIONAL_ACCURACY )
|
||||
@@ -753,7 +753,7 @@ void GenerateConsString( STR16 zItemCons, OBJECTTYPE * pObject, UINT32 uiPixLimi
|
||||
ubWeight = Item[ usItem ].ubWeight;
|
||||
if (Item[ usItem ].usItemClass == IC_GUN)
|
||||
{
|
||||
ubWeight += Item[ pObject->usGunAmmoItem ].ubWeight;
|
||||
ubWeight += Item[ pObject->ItemData.Gun.usGunAmmoItem ].ubWeight;
|
||||
}
|
||||
|
||||
if (ubWeight >= BAD_WEIGHT)
|
||||
@@ -1079,7 +1079,7 @@ void HandleRenderInvSlots( SOLDIERTYPE *pSoldier, UINT8 fDirtyLevel )
|
||||
if ( fDirtyLevel == DIRTYLEVEL2 )
|
||||
{
|
||||
# if defined( _DEBUG ) /* Sergeant_Kolja, to be removed later again */
|
||||
if( pSoldier->inv[ cnt ].ubGunAmmoType >= MAXITEMS )
|
||||
if( pSoldier->inv[ cnt ].ItemData.Gun.ubGunAmmoType >= MAXITEMS )
|
||||
{
|
||||
DebugMsg(TOPIC_JA2, DBG_LEVEL_1, String("pObject (%s) corrupted! GetHelpTextForItem() can crash.", (pSoldier->inv[ cnt ].usItem<MAXITEMS) ? Item[pSoldier->inv[ cnt ].usItem].szItemName : "???" ));
|
||||
ScreenMsg( MSG_FONT_RED, MSG_DEBUG, L"pObject (%S) corrupted! GetHelpTextForItem() can crash.", (pSoldier->inv[ cnt ].usItem<MAXITEMS) ? Item[pSoldier->inv[ cnt ].usItem].szItemName : "???" );
|
||||
@@ -2082,7 +2082,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
|
||||
sNewY = sY + sHeight - 10;
|
||||
sNewX = sX + 1;
|
||||
|
||||
SetFontForeground ( AmmoTypes[pObject->ubGunAmmoType].fontColour );
|
||||
SetFontForeground ( AmmoTypes[pObject->ItemData.Gun.ubGunAmmoType].fontColour );
|
||||
//switch (pObject->ubGunAmmoType)
|
||||
//{
|
||||
// case AMMO_AP:
|
||||
@@ -2108,7 +2108,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
|
||||
//}
|
||||
|
||||
|
||||
swprintf( pStr, L"%d", pObject->ubGunShotsLeft );
|
||||
swprintf( pStr, L"%d", pObject->ItemData.Gun.ubGunShotsLeft );
|
||||
if ( uiBuffer == guiSAVEBUFFER )
|
||||
{
|
||||
RestoreExternBackgroundRect( sNewX, sNewY, 20, 15 );
|
||||
@@ -2119,7 +2119,7 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
|
||||
SetFontForeground( FONT_MCOLOR_DKGRAY );
|
||||
|
||||
// Display 'JAMMED' if we are jammed
|
||||
if ( pObject->bGunAmmoStatus < 0 )
|
||||
if ( pObject->ItemData.Gun.bGunAmmoStatus < 0 )
|
||||
{
|
||||
SetFontForeground( FONT_MCOLOR_RED );
|
||||
|
||||
@@ -2436,14 +2436,14 @@ BOOLEAN InternalInitItemDescriptionBox( OBJECTTYPE *pObject, INT16 sX, INT16 sY,
|
||||
// if( guiCurrentScreen != MAP_SCREEN )
|
||||
//if( guiCurrentItemDescriptionScreen != MAP_SCREEN )
|
||||
if ( GetMagSize(gpItemDescObject) <= 99 )
|
||||
swprintf( pStr, L"%d/%d", gpItemDescObject->ubGunShotsLeft, GetMagSize(gpItemDescObject));
|
||||
swprintf( pStr, L"%d/%d", gpItemDescObject->ItemData.Gun.ubGunShotsLeft, GetMagSize(gpItemDescObject));
|
||||
else
|
||||
swprintf( pStr, L"%d", gpItemDescObject->ubGunShotsLeft );
|
||||
swprintf( pStr, L"%d", gpItemDescObject->ItemData.Gun.ubGunShotsLeft );
|
||||
|
||||
FilenameForBPP("INTERFACE\\infobox.sti", ubString);
|
||||
sForeColour = ITEMDESC_AMMO_FORE;
|
||||
|
||||
giItemDescAmmoButtonImages = LoadButtonImage(ubString,AmmoTypes[pObject->ubGunAmmoType].grayed,AmmoTypes[pObject->ubGunAmmoType].offNormal,-1,AmmoTypes[pObject->ubGunAmmoType].onNormal,-1 );
|
||||
giItemDescAmmoButtonImages = LoadButtonImage(ubString,AmmoTypes[pObject->ItemData.Gun.ubGunAmmoType].grayed,AmmoTypes[pObject->ItemData.Gun.ubGunAmmoType].offNormal,-1,AmmoTypes[pObject->ItemData.Gun.ubGunAmmoType].onNormal,-1 );
|
||||
|
||||
//switch( pObject->ubGunAmmoType )
|
||||
//{
|
||||
@@ -2630,8 +2630,8 @@ BOOLEAN InternalInitItemDescriptionBox( OBJECTTYPE *pObject, INT16 sX, INT16 sY,
|
||||
else
|
||||
{
|
||||
memset( &gRemoveMoney, 0, sizeof( REMOVE_MONEY ) );
|
||||
gRemoveMoney.uiTotalAmount = gpItemDescObject->uiMoneyAmount;
|
||||
gRemoveMoney.uiMoneyRemaining = gpItemDescObject->uiMoneyAmount;
|
||||
gRemoveMoney.uiTotalAmount = gpItemDescObject->ItemData.Money.uiMoneyAmount;
|
||||
gRemoveMoney.uiMoneyRemaining = gpItemDescObject->ItemData.Money.uiMoneyAmount;
|
||||
gRemoveMoney.uiMoneyRemoving = 0;
|
||||
|
||||
// Load graphic
|
||||
@@ -3281,12 +3281,12 @@ void RenderItemDescriptionBox( )
|
||||
if( Item[gpItemDescObject->usItem].usItemClass == IC_AMMO && gpItemDescObject->ubNumberOfObjects > 1 && gubItemDescStatusIndex < gpItemDescObject->ubNumberOfObjects)
|
||||
{
|
||||
//Get weight of one item in stack.
|
||||
UINT8 ubShotsLeftFirst = gpItemDescObject->ubShotsLeft[0];
|
||||
UINT8 ubShotsLeftFirst = gpItemDescObject->ItemData.Ammo.ubShotsLeft[0];
|
||||
UINT8 ubNumberOfObjects = gpItemDescObject->ubNumberOfObjects;
|
||||
gpItemDescObject->ubNumberOfObjects = 1;
|
||||
gpItemDescObject->ubShotsLeft[0] = gpItemDescObject->ubShotsLeft[gubItemDescStatusIndex];
|
||||
gpItemDescObject->ItemData.Ammo.ubShotsLeft[0] = gpItemDescObject->ItemData.Ammo.ubShotsLeft[gubItemDescStatusIndex];
|
||||
fWeight = (float)(CalculateObjectWeight( gpItemDescObject )) / 10;
|
||||
gpItemDescObject->ubShotsLeft[0] = ubShotsLeftFirst;
|
||||
gpItemDescObject->ItemData.Ammo.ubShotsLeft[0] = ubShotsLeftFirst;
|
||||
gpItemDescObject->ubNumberOfObjects = ubNumberOfObjects;
|
||||
}
|
||||
//Item does not exist
|
||||
@@ -3349,7 +3349,7 @@ void RenderItemDescriptionBox( )
|
||||
SetFontForeground( 5 );
|
||||
//Status
|
||||
// This is gross, but to get the % to work out right...
|
||||
swprintf( pStr, L"%2d%%", gpItemDescObject->bStatus[ gubItemDescStatusIndex ] );
|
||||
swprintf( pStr, L"%2d%%", gpItemDescObject->ItemData.Generic.bStatus[ gubItemDescStatusIndex ] );
|
||||
FindFontRightCoordinates( (INT16)(gMapWeaponStats[ 1 ].sX + gsInvDescX + gMapWeaponStats[ 1 ].sValDx + 6), (INT16)(gMapWeaponStats[ 1 ].sY + gsInvDescY ), ITEM_STATS_WIDTH ,ITEM_STATS_HEIGHT ,pStr, BLOCKFONT2, &usX, &usY);
|
||||
wcscat( pStr, L"%%" );
|
||||
mprintf( usX, usY, pStr );
|
||||
@@ -3521,7 +3521,7 @@ void RenderItemDescriptionBox( )
|
||||
{
|
||||
SetFontForeground( FONT_FCOLOR_WHITE );
|
||||
SetFontShadow( DEFAULT_SHADOW );
|
||||
swprintf( pStr, L"%ld", gpItemDescObject->uiMoneyAmount );
|
||||
swprintf( pStr, L"%ld", gpItemDescObject->ItemData.Money.uiMoneyAmount );
|
||||
InsertCommasForDollarFigure( pStr );
|
||||
InsertDollarSignInToString( pStr );
|
||||
uiStringLength=StringPixLength(pStr, ITEMDESC_FONT );
|
||||
@@ -3554,7 +3554,7 @@ void RenderItemDescriptionBox( )
|
||||
if ( Item[ gpItemDescObject->usItem ].usItemClass & IC_AMMO )
|
||||
{
|
||||
// Ammo
|
||||
swprintf( pStr, L"%d/%d", gpItemDescObject->ubShotsLeft[gubItemDescStatusIndex], Magazine[ Item[ gpItemDescObject->usItem ].ubClassIndex ].ubMagSize ); //Pulmu: Correct # of rounds for stacked ammo.
|
||||
swprintf( pStr, L"%d/%d", gpItemDescObject->ItemData.Ammo.ubShotsLeft[gubItemDescStatusIndex], Magazine[ Item[ gpItemDescObject->usItem ].ubClassIndex ].ubMagSize ); //Pulmu: Correct # of rounds for stacked ammo.
|
||||
uiStringLength=StringPixLength(pStr, ITEMDESC_FONT );
|
||||
// sStrX = gMapWeaponStats[ 0 ].sX + gsInvDescX + gMapWeaponStats[ 0 ].sValDx + ( uiRightLength - uiStringLength );
|
||||
FindFontRightCoordinates( (INT16)(gMapWeaponStats[ 2 ].sX + gsInvDescX + gMapWeaponStats[ 2 ].sValDx+6), (INT16)(gMapWeaponStats[ 2 ].sY + gsInvDescY ), ITEM_STATS_WIDTH ,ITEM_STATS_HEIGHT ,pStr, BLOCKFONT2, &sStrX, &usY);
|
||||
@@ -3563,7 +3563,7 @@ void RenderItemDescriptionBox( )
|
||||
else
|
||||
{
|
||||
//Status
|
||||
swprintf( pStr, L"%2d%%", gpItemDescObject->bStatus[ gubItemDescStatusIndex ] );
|
||||
swprintf( pStr, L"%2d%%", gpItemDescObject->ItemData.Generic.bStatus[ gubItemDescStatusIndex ] );
|
||||
uiStringLength=StringPixLength(pStr, ITEMDESC_FONT );
|
||||
// sStrX = gMapWeaponStats[ 1 ].sX + gsInvDescX + gMapWeaponStats[ 1 ].sValDx + ( uiRightLength - uiStringLength );
|
||||
FindFontRightCoordinates( (INT16)(gMapWeaponStats[ 1 ].sX + gsInvDescX + gMapWeaponStats[ 1 ].sValDx + 6), (INT16)(gMapWeaponStats[ 1 ].sY + gsInvDescY ), ITEM_STATS_WIDTH ,ITEM_STATS_HEIGHT ,pStr, BLOCKFONT2, &sStrX, &usY);
|
||||
@@ -3590,12 +3590,12 @@ void RenderItemDescriptionBox( )
|
||||
|
||||
|
||||
SetFontForeground( 5 );
|
||||
GetShortSectorString( ( INT16 ) SECTORX( KeyTable[ gpItemDescObject->ubKeyID ].usSectorFound ), ( INT16 ) SECTORY( KeyTable[ gpItemDescObject->ubKeyID ].usSectorFound ), sTempString );
|
||||
GetShortSectorString( ( INT16 ) SECTORX( KeyTable[ gpItemDescObject->ItemData.Key.ubKeyID ].usSectorFound ), ( INT16 ) SECTORY( KeyTable[ gpItemDescObject->ItemData.Key.ubKeyID ].usSectorFound ), sTempString );
|
||||
swprintf( pStr, L"%s", sTempString );
|
||||
FindFontRightCoordinates( (INT16)(gMapWeaponStats[ 4 ].sX + gsInvDescX ), (INT16)(gMapWeaponStats[ 4 ].sY + gsInvDescY ), 110 ,ITEM_STATS_HEIGHT ,pStr, BLOCKFONT2, &usX, &usY);
|
||||
mprintf( usX, usY, pStr );
|
||||
|
||||
swprintf( pStr, L"%d", KeyTable[ gpItemDescObject->ubKeyID ].usDateFound );
|
||||
swprintf( pStr, L"%d", KeyTable[ gpItemDescObject->ItemData.Key.ubKeyID ].usDateFound );
|
||||
FindFontRightCoordinates( (INT16)(gMapWeaponStats[ 4 ].sX + gsInvDescX ), (INT16)(gMapWeaponStats[ 4 ].sY + gsInvDescY + GetFontHeight( BLOCKFONT ) + 2 ), 110 ,ITEM_STATS_HEIGHT ,pStr, BLOCKFONT2, &usX, &usY);
|
||||
mprintf( usX, usY, pStr );
|
||||
}
|
||||
@@ -3775,12 +3775,12 @@ void RenderItemDescriptionBox( )
|
||||
if( Item[gpItemDescObject->usItem].usItemClass == IC_AMMO && gpItemDescObject->ubNumberOfObjects > 1 && gubItemDescStatusIndex < gpItemDescObject->ubNumberOfObjects)
|
||||
{
|
||||
//Get weight of one ammo clip in stack.
|
||||
UINT8 ubShotsLeftFirst = gpItemDescObject->ubShotsLeft[0];
|
||||
UINT8 ubShotsLeftFirst = gpItemDescObject->ItemData.Ammo.ubShotsLeft[0];
|
||||
UINT8 ubNumberOfObjects = gpItemDescObject->ubNumberOfObjects;
|
||||
gpItemDescObject->ubNumberOfObjects = 1;
|
||||
gpItemDescObject->ubShotsLeft[0] = gpItemDescObject->ubShotsLeft[gubItemDescStatusIndex];
|
||||
gpItemDescObject->ItemData.Ammo.ubShotsLeft[0] = gpItemDescObject->ItemData.Ammo.ubShotsLeft[gubItemDescStatusIndex];
|
||||
fWeight = (float)(CalculateObjectWeight( gpItemDescObject )) / 10;
|
||||
gpItemDescObject->ubShotsLeft[0] = ubShotsLeftFirst;
|
||||
gpItemDescObject->ItemData.Ammo.ubShotsLeft[0] = ubShotsLeftFirst;
|
||||
gpItemDescObject->ubNumberOfObjects = ubNumberOfObjects;
|
||||
}
|
||||
//Item does not exist
|
||||
@@ -3850,7 +3850,7 @@ void RenderItemDescriptionBox( )
|
||||
}
|
||||
|
||||
//Status
|
||||
swprintf( pStr, L"%2d%%", gpItemDescObject->bGunStatus );
|
||||
swprintf( pStr, L"%2d%%", gpItemDescObject->ItemData.Gun.bGunStatus );
|
||||
FindFontRightCoordinates( (INT16)(gWeaponStats[ 1 ].sX + gsInvDescX + gWeaponStats[ 1 ].sValDx), (INT16)(gWeaponStats[ 1 ].sY + gsInvDescY ), ITEM_STATS_WIDTH ,ITEM_STATS_HEIGHT ,pStr, BLOCKFONT2, &usX, &usY);
|
||||
wcscat( pStr, L"%%" );
|
||||
mprintf( usX, usY, pStr );
|
||||
@@ -4018,7 +4018,7 @@ void RenderItemDescriptionBox( )
|
||||
{
|
||||
SetFontForeground( FONT_FCOLOR_WHITE );
|
||||
SetFontShadow( DEFAULT_SHADOW );
|
||||
swprintf( pStr, L"%ld", gpItemDescObject->uiMoneyAmount );
|
||||
swprintf( pStr, L"%ld", gpItemDescObject->ItemData.Money.uiMoneyAmount );
|
||||
InsertCommasForDollarFigure( pStr );
|
||||
InsertDollarSignInToString( pStr );
|
||||
|
||||
@@ -4054,14 +4054,14 @@ void RenderItemDescriptionBox( )
|
||||
{
|
||||
// Ammo - print amount
|
||||
//Status
|
||||
swprintf( pStr, L"%d/%d", gpItemDescObject->ubShotsLeft[gubItemDescStatusIndex], Magazine[ Item[ gpItemDescObject->usItem ].ubClassIndex ].ubMagSize ); //Pulmu: Correct # of rounds for stacked ammo
|
||||
swprintf( pStr, L"%d/%d", gpItemDescObject->ItemData.Ammo.ubShotsLeft[gubItemDescStatusIndex], Magazine[ Item[ gpItemDescObject->usItem ].ubClassIndex ].ubMagSize ); //Pulmu: Correct # of rounds for stacked ammo
|
||||
FindFontRightCoordinates( (INT16)(gWeaponStats[ 2 ].sX + gsInvDescX + gWeaponStats[ 2 ].sValDx), (INT16)(gWeaponStats[ 2 ].sY + gsInvDescY ), ITEM_STATS_WIDTH ,ITEM_STATS_HEIGHT ,pStr, BLOCKFONT2, &usX, &usY);
|
||||
mprintf( usX, usY, pStr );
|
||||
}
|
||||
else
|
||||
{
|
||||
//Status
|
||||
swprintf( pStr, L"%2d%%", gpItemDescObject->bStatus[ gubItemDescStatusIndex ] );
|
||||
swprintf( pStr, L"%2d%%", gpItemDescObject->ItemData.Generic.bStatus[ gubItemDescStatusIndex ] );
|
||||
FindFontRightCoordinates( (INT16)(gWeaponStats[ 1 ].sX + gsInvDescX + gWeaponStats[ 1 ].sValDx), (INT16)(gWeaponStats[ 1 ].sY + gsInvDescY ), ITEM_STATS_WIDTH ,ITEM_STATS_HEIGHT ,pStr, BLOCKFONT2, &usX, &usY);
|
||||
wcscat( pStr, L"%%" );
|
||||
mprintf( usX, usY, pStr );
|
||||
@@ -4079,12 +4079,12 @@ void RenderItemDescriptionBox( )
|
||||
|
||||
|
||||
SetFontForeground( 5 );
|
||||
GetShortSectorString( ( INT16 ) SECTORX( KeyTable[ gpItemDescObject->ubKeyID ].usSectorFound ), ( INT16 ) SECTORY( KeyTable[ gpItemDescObject->ubKeyID ].usSectorFound ), sTempString );
|
||||
GetShortSectorString( ( INT16 ) SECTORX( KeyTable[ gpItemDescObject->ItemData.Key.ubKeyID ].usSectorFound ), ( INT16 ) SECTORY( KeyTable[ gpItemDescObject->ItemData.Key.ubKeyID ].usSectorFound ), sTempString );
|
||||
swprintf( pStr, L"%s", sTempString );
|
||||
FindFontRightCoordinates( (INT16)(gWeaponStats[ 4 ].sX + gsInvDescX ), (INT16)(gWeaponStats[ 4 ].sY + gsInvDescY ), 110 ,ITEM_STATS_HEIGHT ,pStr, BLOCKFONT2, &usX, &usY);
|
||||
mprintf( usX, usY, pStr );
|
||||
|
||||
swprintf( pStr, L"%d", KeyTable[ gpItemDescObject->ubKeyID ].usDateFound );
|
||||
swprintf( pStr, L"%d", KeyTable[ gpItemDescObject->ItemData.Key.ubKeyID ].usDateFound );
|
||||
FindFontRightCoordinates( (INT16)(gWeaponStats[ 4 ].sX + gsInvDescX ), (INT16)(gWeaponStats[ 4 ].sY + gsInvDescY + GetFontHeight( BLOCKFONT ) + 2 ), 110 ,ITEM_STATS_HEIGHT ,pStr, BLOCKFONT2, &usX, &usY);
|
||||
mprintf( usX, usY, pStr );
|
||||
}
|
||||
@@ -5673,7 +5673,7 @@ void RenderKeyRingPopup( BOOLEAN fFullRender )
|
||||
memset( &pObject, 0, sizeof( OBJECTTYPE ) );
|
||||
|
||||
pObject.usItem = KEY_1;
|
||||
pObject.bStatus[ 0 ] = 100;
|
||||
pObject.ItemData.Generic.bStatus[ 0 ] = 100;
|
||||
|
||||
// TAKE A LOOK AT THE VIDEO OBJECT SIZE ( ONE OF TWO SIZES ) AND CENTER!
|
||||
GetVideoObject( &hVObject, guiItemPopupBoxes );
|
||||
@@ -6517,7 +6517,7 @@ void SetupPickupPage( INT8 bPage )
|
||||
pObject = (gfStealing)? &gpOpponent->inv[pTempItemPool->iItemIndex]
|
||||
:&(gWorldItems[ pTempItemPool->iItemIndex ].o );
|
||||
|
||||
sValue = pObject->bStatus[ 0 ];
|
||||
sValue = pObject->ItemData.Generic.bStatus[ 0 ];
|
||||
|
||||
// Adjust for ammo, other thingys..
|
||||
if( Item[ pObject->usItem ].usItemClass & IC_AMMO || Item[ pObject->usItem ].usItemClass & IC_KEY )
|
||||
@@ -6789,7 +6789,7 @@ void RenderItemPickupMenu( )
|
||||
if ( Item[ pObject->usItem ].usItemClass == IC_MONEY )
|
||||
{
|
||||
CHAR16 pStr2[20];
|
||||
swprintf( pStr2, L"%ld", pObject->uiMoneyAmount );
|
||||
swprintf( pStr2, L"%ld", pObject->ItemData.Money.uiMoneyAmount );
|
||||
InsertCommasForDollarFigure( pStr2 );
|
||||
InsertDollarSignInToString( pStr2 );
|
||||
|
||||
@@ -7337,22 +7337,22 @@ void RemoveMoney()
|
||||
InvSlot.bSlotIdInOtherLocation = -1;
|
||||
|
||||
//Remove the money from the money in the pocket
|
||||
gpItemDescObject->uiMoneyAmount = gRemoveMoney.uiMoneyRemaining;
|
||||
gpItemDescObject->ItemData.Money.uiMoneyAmount = gRemoveMoney.uiMoneyRemaining;
|
||||
|
||||
//Create an item to get the money that is being removed
|
||||
CreateItem( MONEY, 0, &InvSlot.ItemObject );
|
||||
|
||||
//Set the amount thast is being removed
|
||||
InvSlot.ItemObject.uiMoneyAmount = gRemoveMoney.uiMoneyRemoving;
|
||||
InvSlot.ItemObject.ItemData.Money.uiMoneyAmount = gRemoveMoney.uiMoneyRemoving;
|
||||
InvSlot.ubIdOfMercWhoOwnsTheItem = gpItemDescSoldier->ubProfile;
|
||||
|
||||
//if we are removing money from the players account
|
||||
if( gfAddingMoneyToMercFromPlayersAccount )
|
||||
{
|
||||
gpItemDescObject->uiMoneyAmount = gRemoveMoney.uiMoneyRemoving;
|
||||
gpItemDescObject->ItemData.Money.uiMoneyAmount = gRemoveMoney.uiMoneyRemoving;
|
||||
|
||||
//take the money from the player
|
||||
AddTransactionToPlayersBook ( TRANSFER_FUNDS_TO_MERC, gpSMCurrentMerc->ubProfile, GetWorldTotalMin() , -(INT32)( gpItemDescObject->uiMoneyAmount ) );
|
||||
AddTransactionToPlayersBook ( TRANSFER_FUNDS_TO_MERC, gpSMCurrentMerc->ubProfile, GetWorldTotalMin() , -(INT32)( gpItemDescObject->ItemData.Money.uiMoneyAmount ) );
|
||||
}
|
||||
|
||||
memcpy( &gMoveingItem, &InvSlot, sizeof( INVENTORY_IN_SLOT ) );
|
||||
@@ -7378,13 +7378,13 @@ void RemoveMoney()
|
||||
//if we are removing money from the players account
|
||||
if( gfAddingMoneyToMercFromPlayersAccount )
|
||||
{
|
||||
gpItemDescObject->uiMoneyAmount = gRemoveMoney.uiMoneyRemoving;
|
||||
gpItemDescObject->ItemData.Money.uiMoneyAmount = gRemoveMoney.uiMoneyRemoving;
|
||||
|
||||
//take the money from the player
|
||||
AddTransactionToPlayersBook ( TRANSFER_FUNDS_TO_MERC, gpSMCurrentMerc->ubProfile, GetWorldTotalMin() , -(INT32)( gpItemDescObject->uiMoneyAmount ) );
|
||||
AddTransactionToPlayersBook ( TRANSFER_FUNDS_TO_MERC, gpSMCurrentMerc->ubProfile, GetWorldTotalMin() , -(INT32)( gpItemDescObject->ItemData.Money.uiMoneyAmount ) );
|
||||
}
|
||||
else
|
||||
gpItemDescObject->uiMoneyAmount = gRemoveMoney.uiMoneyRemaining;
|
||||
gpItemDescObject->ItemData.Money.uiMoneyAmount = gRemoveMoney.uiMoneyRemaining;
|
||||
|
||||
|
||||
|
||||
@@ -7438,7 +7438,7 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
Remove when fixed!
|
||||
*/
|
||||
# if defined( _DEBUG )
|
||||
if ( (pObject->ubGunAmmoType >= MAXITEMS)
|
||||
if ( (pObject->ItemData.Gun.ubGunAmmoType >= MAXITEMS)
|
||||
)
|
||||
{
|
||||
DebugMsg(TOPIC_JA2, DBG_LEVEL_1, String( "corrupted pObject (%s) found in GetHelpTextForItem()", (usItem<MAXITEMS) ? Item[usItem].szItemName : "???" ));
|
||||
@@ -7453,13 +7453,13 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
{
|
||||
// Retrieve the status of the items
|
||||
// Find the minimum status value - not just the first one
|
||||
INT16 sValue = pObject->bStatus[ 0 ];
|
||||
INT16 sValue = pObject->ItemData.Generic.bStatus[ 0 ];
|
||||
|
||||
for(INT16 i = 1; i < pObject->ubNumberOfObjects; i++)
|
||||
{
|
||||
if(pObject->bStatus[ i ] < sValue)
|
||||
if(pObject->ItemData.Generic.bStatus[ i ] < sValue)
|
||||
{
|
||||
sValue = pObject->bStatus[ i ];
|
||||
sValue = pObject->ItemData.Generic.bStatus[ i ];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7485,7 +7485,7 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
case MONEY:
|
||||
//Money
|
||||
{
|
||||
swprintf( pStr, L"%ld", pObject->uiMoneyAmount );
|
||||
swprintf( pStr, L"%ld", pObject->ItemData.Money.uiMoneyAmount );
|
||||
InsertCommasForDollarFigure( pStr );
|
||||
InsertDollarSignInToString( pStr );
|
||||
}
|
||||
@@ -7496,7 +7496,7 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
//if ( Item[ usItem ].usItemClass == IC_MONEY )
|
||||
{
|
||||
CHAR16 pStr2[20];
|
||||
swprintf( pStr2, L"%ld", pObject->uiMoneyAmount );
|
||||
swprintf( pStr2, L"%ld", pObject->ItemData.Money.uiMoneyAmount );
|
||||
InsertCommasForDollarFigure( pStr2 );
|
||||
InsertDollarSignInToString( pStr2 );
|
||||
|
||||
@@ -7633,7 +7633,7 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
|
||||
// The next is for ammunition which gets the measurement 'rnds'
|
||||
swprintf( pStr, L"%s [%d rnds]\n%s %1.1f %s",
|
||||
ItemNames[ usItem ], //Item long name
|
||||
pObject->ubShotsLeft[0], //Shots left
|
||||
pObject->ItemData.Ammo.ubShotsLeft[0], //Shots left
|
||||
gWeaponStatsDesc[ 12 ], //Weight String
|
||||
fWeight, //Weight
|
||||
GetWeightUnitString() //Weight units
|
||||
|
||||
Reference in New Issue
Block a user