From e0448af30d7421ff2a3cc9c5d4a70f05c1dd286c Mon Sep 17 00:00:00 2001 From: Wanne Date: Sun, 6 Apr 2014 18:31:56 +0000 Subject: [PATCH] Merged from revision: 7140 Bugfix (by anv) - possible crash when viewing general stats of machineguns with no single shot available (due to comparison feature) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7141 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Interface Enhanced.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Tactical/Interface Enhanced.cpp b/Tactical/Interface Enhanced.cpp index 3a653194c..68d246e4c 100644 --- a/Tactical/Interface Enhanced.cpp +++ b/Tactical/Interface Enhanced.cpp @@ -8310,11 +8310,10 @@ void DrawWeaponValues( OBJECTTYPE * gpItemDescObject ) // Reset font color SetFontForeground( 6 ); } - else + else if( fComparisonMode ) { if( !Weapon[gpComparedItemDescObject->usItem].NoSemiAuto ) - { - INT16 iComparedSingleAPCost = BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], gpComparedItemDescObject, NULL ); + { INT16 iComparedSingleAPCost = BaseAPsToShootOrStab( APBPConstants[DEFAULT_APS], APBPConstants[DEFAULT_AIMSKILL], gpComparedItemDescObject, NULL ); SetFontForeground( ITEMDESC_FONTPOSITIVE ); swprintf( pStr, L"%d", iComparedSingleAPCost ); }