- Bugfix: Fixed crash when showing attachment slots in EDB (strategy) and left clicking on a attachment slot (for non weapons)

o This bug was introduced when merging HAM 5

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5224 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2012-04-24 14:42:59 +00:00
parent 24982ba1d1
commit 4f120f152f
+20 -9
View File
@@ -607,15 +607,21 @@ bool popupCallbackItemInSector(INT16 itemId){
void hideAttachmentPopup(){
giActiveAttachmentPopup = -1;
if (giInvDescTabButton[0] != giItemDescAmmoButton)
ShowButton(giItemDescAmmoButton);
if (giItemDescAmmoButton > -1)
{
if (giInvDescTabButton[0] != giItemDescAmmoButton)
ShowButton(giItemDescAmmoButton);
}
}
void hideOtherAttachmentPopups(UINT32 cnt){
// if there's a bullet icon, hide it. It tends to overlap my popup boxes
if (giInvDescTabButton[0] != giItemDescAmmoButton)
HideButton(giItemDescAmmoButton);
if (giItemDescAmmoButton != -1)
{
if (giInvDescTabButton[0] != giItemDescAmmoButton)
HideButton(giItemDescAmmoButton);
}
RenderItemDescriptionBox(); // also, redraw the IDB to clean up helptext
@@ -11915,7 +11921,7 @@ void ItemDescTabButtonCallback( GUI_BUTTON *btn, INT32 reason )
InternalInitEDBTooltipRegion( gpItemDescObject, guiCurrentItemDescriptionScreen );
RenderItemDescriptionBox();
if (giItemDescAmmoButton != -1)
if (giItemDescAmmoButton > -1)
MarkAButtonDirty( giItemDescAmmoButton ); // Required for tactical screen
ItemDescTabButtonOn( 0 );
@@ -11927,7 +11933,7 @@ void ItemDescTabButtonCallback( GUI_BUTTON *btn, INT32 reason )
InternalInitEDBTooltipRegion( gpItemDescObject, guiCurrentItemDescriptionScreen );
RenderItemDescriptionBox();
if (giItemDescAmmoButton != -1)
if (giItemDescAmmoButton > -1)
MarkAButtonDirty( giItemDescAmmoButton ); // Required for tactical screen
ItemDescTabButtonOff( 0 );
@@ -11939,7 +11945,7 @@ void ItemDescTabButtonCallback( GUI_BUTTON *btn, INT32 reason )
InternalInitEDBTooltipRegion( gpItemDescObject, guiCurrentItemDescriptionScreen );
RenderItemDescriptionBox();
if (giItemDescAmmoButton != -1)
if (giItemDescAmmoButton > -1)
MarkAButtonDirty( giItemDescAmmoButton ); // Required for tactical screen
ItemDescTabButtonOff( 0 );
@@ -11994,7 +12000,10 @@ void ItemDescAdvButtonCallback( GUI_BUTTON *btn, INT32 reason )
InternalInitEDBTooltipRegion( gpItemDescObject, guiCurrentItemDescriptionScreen );
RenderItemDescriptionBox();
// Required for tactical screen
MarkAButtonDirty( giItemDescAmmoButton );
if (giItemDescAmmoButton > -1)
MarkAButtonDirty( giItemDescAmmoButton );
for (INT8 x = 0; x < 3; x++)
{
if (giInvDescTabButton[x] != -1)
@@ -12012,7 +12021,9 @@ void ItemDescAdvButtonCallback( GUI_BUTTON *btn, INT32 reason )
InternalInitEDBTooltipRegion( gpItemDescObject, guiCurrentItemDescriptionScreen );
RenderItemDescriptionBox();
// Required for tactical screen
MarkAButtonDirty( giItemDescAmmoButton );
if (giItemDescAmmoButton > -1)
MarkAButtonDirty( giItemDescAmmoButton );
for (INT8 x = 0; x < 3; x++)
{
if (giInvDescTabButton[x] != -1)