From a9a88e4642bb5f9e068177df50c0bb897d96bd05 Mon Sep 17 00:00:00 2001 From: ChrisL Date: Thu, 9 Jun 2011 16:43:02 +0000 Subject: [PATCH] BUGFIX 525 - Corrected UDB display issue where ammo and RangeBonus are concerned. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4490 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Interface Enhanced.cpp | 14 +++++++++++++- Tactical/Items.cpp | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Tactical/Interface Enhanced.cpp b/Tactical/Interface Enhanced.cpp index 64bb308ac..4d3ab05c5 100644 --- a/Tactical/Interface Enhanced.cpp +++ b/Tactical/Interface Enhanced.cpp @@ -8026,14 +8026,26 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject ) if (iModifier[cnt2] > 0) { SetFontForeground( ITEMDESC_FONTPOSITIVE ); - swprintf( pStr, L"+%d", iModifier[cnt2] ); + swprintf( pStr, L"%d", iModifier[cnt2] ); + wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + #ifdef CHINESE + wcscat( pStr, ChineseSpecString1 ); + #else + wcscat( pStr, L"%" ); + #endif } else if (iModifier[cnt2] < 0) { SetFontForeground( ITEMDESC_FONTNEGATIVE ); swprintf( pStr, L"%d", iModifier[cnt2] ); + wcscat( pStr, L"%" ); FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY); + #ifdef CHINESE + wcscat( pStr, ChineseSpecString1 ); + #else + wcscat( pStr, L"%" ); + #endif } else { diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index bb5a0d999..19870e3d6 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -9041,6 +9041,8 @@ INT16 GetRangeBonus( OBJECTTYPE * pObj ) { INT16 bonus = 0; if (pObj->exists() == true) { + if(Item[pObj->usItem].usItemClass == IC_AMMO) + return( Item[pObj->usItem].rangebonus ); bonus = BonusReduce( Item[pObj->usItem].rangebonus, (*pObj)[0]->data.objectStatus ); if ( (*pObj)[0]->data.gun.ubGunShotsLeft > 0 )