mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Fixed soldier tooltips showing attachments when they shouldn't be
Cleaned up PxItems code to not be so messy, and be more flexible later once we can figure out a way to enable P4-P9items again git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5253 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -514,19 +514,17 @@ void DisplayWeaponInfo( SOLDIERTYPE* pSoldier, CHAR16* pStrInfo, UINT8 ubSlot, U
|
||||
// display weapon attachments
|
||||
for (attachmentList::iterator iter = pSoldier->inv[ubSlot][0]->attachments.begin(); iter != pSoldier->inv[ubSlot][0]->attachments.end(); ++iter) {
|
||||
if(iter->exists()){
|
||||
if ( ubTooltipDetailLevel == DL_Basic )
|
||||
fDisplayAttachment = FALSE; //Madd: changed this, it was incorrectly showing attachments when it shouldn't be
|
||||
|
||||
if ( ubTooltipDetailLevel == DL_Basic || ubTooltipDetailLevel == DL_Full ) // Madd: also hidden attachments should be hidden at the full level as well... unless the mercs have x-ray vision to see that rod&spring inside the gun!! :p
|
||||
{
|
||||
// display only externally-visible weapon attachments
|
||||
if ( !Item[iter->usItem].hiddenattachment )
|
||||
{
|
||||
fDisplayAttachment = TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// display all weapon attachments
|
||||
fDisplayAttachment = TRUE;
|
||||
if ( Item[iter->usItem].hiddenattachment )
|
||||
fDisplayAttachment = FALSE;
|
||||
else
|
||||
fDisplayAttachment = TRUE;
|
||||
}
|
||||
|
||||
if ( fDisplayAttachment )
|
||||
{
|
||||
iNumAttachments++;
|
||||
@@ -535,7 +533,6 @@ void DisplayWeaponInfo( SOLDIERTYPE* pSoldier, CHAR16* pStrInfo, UINT8 ubSlot, U
|
||||
else
|
||||
wcscat( pStrInfo, L", " );
|
||||
wcscat( pStrInfo, ItemNames[ iter->usItem ] );
|
||||
fDisplayAttachment = FALSE; // clear flag for next loop iteration
|
||||
}
|
||||
}
|
||||
} // for
|
||||
|
||||
Reference in New Issue
Block a user