From 3f9cb6b833df75b949a089bf4b56eff9c13655c4 Mon Sep 17 00:00:00 2001 From: ChrisL Date: Mon, 6 Jun 2011 23:09:16 +0000 Subject: [PATCH] BUGFIX 497 - Aim Level function was not allowing negative aim levels which might initially make sense, but if any modifiers would result in a negative value, we'd end up with an high value which would then get reset by the built in limits. I've recast the variable to an INT8 which will allow negative results, at least prior to the built in limits being applied. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4481 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Interface Enhanced.cpp | 12 ++++++------ Tactical/Items.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Tactical/Interface Enhanced.cpp b/Tactical/Interface Enhanced.cpp index 365a9844..64bb308a 100644 --- a/Tactical/Interface Enhanced.cpp +++ b/Tactical/Interface Enhanced.cpp @@ -2504,15 +2504,15 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr { if( UsingNewCTHSystem() == false ) { - swprintf( pStr, L"%s", szUDBAdvStatsTooltipText[ 46 ]); + swprintf( pStr, L"%s", szUDBAdvStatsTooltipText[ 47 ]); } else if (Item[ gpItemDescObject->usItem ].usItemClass & (IC_WEAPON|IC_PUNCH)) { - swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 46 ], szUDBAdvStatsExplanationsTooltipTextForWeapons[ 46 ]); + swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 47 ], szUDBAdvStatsExplanationsTooltipTextForWeapons[ 47 ]); } else { - swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 46 ], szUDBAdvStatsExplanationsTooltipText[ 46 ]); + swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 47 ], szUDBAdvStatsExplanationsTooltipText[ 47 ]); } SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ]), pStr ); MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ] ); @@ -2531,15 +2531,15 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr { if( UsingNewCTHSystem() == false ) { - swprintf( pStr, L"%s", szUDBAdvStatsTooltipText[ 47 ]); + swprintf( pStr, L"%s", szUDBAdvStatsTooltipText[ 46 ]); } else if (Item[ gpItemDescObject->usItem ].usItemClass & (IC_WEAPON|IC_PUNCH)) { - swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 47 ], szUDBAdvStatsExplanationsTooltipTextForWeapons[ 47 ]); + swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 46 ], szUDBAdvStatsExplanationsTooltipTextForWeapons[ 46 ]); } else { - swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 47 ], szUDBAdvStatsExplanationsTooltipText[ 47 ]); + swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 46 ], szUDBAdvStatsExplanationsTooltipText[ 46 ]); } SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ]), pStr ); MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ] ); diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index a1b12625..bb5a0d99 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -11622,7 +11622,7 @@ UINT8 GetAllowedAimingLevelsForItem( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObj, UI return 1; } - UINT8 aimLevels = 4; + INT8 aimLevels = 4; // HEADROCK HAM B2.6: Dynamic aiming level restrictions based on gun type and attachments. // HEADROCK HAM 3.5: Revamped this - it was illogically constructed.