mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
Hide asterisk for attachments when hiddenAttachment tag = 1
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5245 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+28
-7
@@ -2009,21 +2009,42 @@ OBJECTTYPE* FindNonSmokeLaunchableAttachment( OBJECTTYPE * pObj, UINT16 usWeapon
|
||||
return( FindLaunchableAttachment(pObj,usWeapon) );
|
||||
}
|
||||
|
||||
|
||||
//Simple check to see if the item has any attachments
|
||||
//Madd: if there are only hidden attachments this will now return false, so the asterisk won't be display if the hiddenAttachment tag is true
|
||||
BOOLEAN ItemHasAttachments( OBJECTTYPE * pObj, SOLDIERTYPE * pSoldier, UINT8 iter )
|
||||
{
|
||||
BOOLEAN attachmentHidden = TRUE;
|
||||
if (pObj->exists() == true) {
|
||||
if(pSoldier != NULL){
|
||||
for (iter = 0; iter != pObj->objectStack.size(); ++iter) {
|
||||
if((*pObj)[iter]->AttachmentListSize() > 0){
|
||||
return TRUE;
|
||||
for (iter = 0; iter != pObj->objectStack.size(); ++iter)
|
||||
{
|
||||
if((*pObj)[iter]->AttachmentListSize() > 0)
|
||||
{
|
||||
for(attachmentList::iterator att = (*pObj)[iter]->attachments.begin(); att != (*pObj)[iter]->attachments.end(); ++att)
|
||||
{
|
||||
if ( att->usItem != 0 && !Item[att->usItem].hiddenattachment )
|
||||
{
|
||||
attachmentHidden = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return !attachmentHidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
if((*pObj)[iter]->AttachmentListSize() > 0){
|
||||
return TRUE;
|
||||
else
|
||||
{
|
||||
if((*pObj)[iter]->AttachmentListSize() > 0)
|
||||
{
|
||||
for(attachmentList::iterator att = (*pObj)[iter]->attachments.begin(); att != (*pObj)[iter]->attachments.end(); ++att)
|
||||
{
|
||||
if ( att->usItem != 0 && !Item[att->usItem].hiddenattachment )
|
||||
{
|
||||
attachmentHidden = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return !attachmentHidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user