From c32ccdfa74e7bb994a942bd0254e9c6b84800155 Mon Sep 17 00:00:00 2001 From: Wanne Date: Mon, 23 Apr 2012 21:02:31 +0000 Subject: [PATCH] - Bugfix: Fixed CTD, when trying to show "Adv" or "Gen" Tab on the EDB for non weapon items o This bug was introduced in revision 5181 when HAM 5 was merged git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5220 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Interface Items.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Tactical/Interface Items.cpp b/Tactical/Interface Items.cpp index fbbac0879..b4b3fcc11 100644 --- a/Tactical/Interface Items.cpp +++ b/Tactical/Interface Items.cpp @@ -11914,7 +11914,10 @@ void ItemDescTabButtonCallback( GUI_BUTTON *btn, INT32 reason ) gubDescBoxPage = 0; InternalInitEDBTooltipRegion( gpItemDescObject, guiCurrentItemDescriptionScreen ); RenderItemDescriptionBox(); - MarkAButtonDirty( giItemDescAmmoButton ); // Required for tactical screen + + if (giItemDescAmmoButton != -1) + MarkAButtonDirty( giItemDescAmmoButton ); // Required for tactical screen + ItemDescTabButtonOn( 0 ); ItemDescTabButtonOff( 1 ); ItemDescTabButtonOff( 2 ); @@ -11923,7 +11926,10 @@ void ItemDescTabButtonCallback( GUI_BUTTON *btn, INT32 reason ) gubDescBoxPage = 1; InternalInitEDBTooltipRegion( gpItemDescObject, guiCurrentItemDescriptionScreen ); RenderItemDescriptionBox(); - MarkAButtonDirty( giItemDescAmmoButton ); // Required for tactical screen + + if (giItemDescAmmoButton != -1) + MarkAButtonDirty( giItemDescAmmoButton ); // Required for tactical screen + ItemDescTabButtonOff( 0 ); ItemDescTabButtonOn( 1 ); ItemDescTabButtonOff( 2 ); @@ -11932,7 +11938,10 @@ void ItemDescTabButtonCallback( GUI_BUTTON *btn, INT32 reason ) gubDescBoxPage = 2; InternalInitEDBTooltipRegion( gpItemDescObject, guiCurrentItemDescriptionScreen ); RenderItemDescriptionBox(); - MarkAButtonDirty( giItemDescAmmoButton ); // Required for tactical screen + + if (giItemDescAmmoButton != -1) + MarkAButtonDirty( giItemDescAmmoButton ); // Required for tactical screen + ItemDescTabButtonOff( 0 ); ItemDescTabButtonOff( 1 ); ItemDescTabButtonOn( 2 );