From bc498640000b059187871ede0dc064b740810570 Mon Sep 17 00:00:00 2001 From: Flugente Date: Thu, 25 Jul 2013 21:43:04 +0000 Subject: [PATCH] Fix: crash when transforming attached items on guns with magsize modifiers git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6244 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Interface Items.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tactical/Interface Items.cpp b/Tactical/Interface Items.cpp index db4f14bc2..3bcd040da 100644 --- a/Tactical/Interface Items.cpp +++ b/Tactical/Interface Items.cpp @@ -5781,6 +5781,10 @@ void RenderBulletIcon(OBJECTTYPE *pObject, UINT32 ubStatusIndex) if(!gfInItemDescBox) return; + // Flugente: if the ammo button does not exist, no point in entering its text... + if ( giItemDescAmmoButton < 0 ) + return; + if ( GetMagSize(pObject) <= 99 ) swprintf( pStr, L"%d/%d", (*pObject)[ubStatusIndex]->data.gun.ubGunShotsLeft, GetMagSize(pObject)); else