From 72f01b53790197d8d21d92f3ba3a188a46a52bfa Mon Sep 17 00:00:00 2001 From: kitty624 <58940527+kitty624@users.noreply.github.com> Date: Wed, 10 Apr 2024 09:22:01 +0200 Subject: [PATCH] Fix Attachable Launchers Slot Tooltips fix: launchables made valid by attached launchers are now again shown as tooltip and can be attached to slot with click fixes https://github.com/1dot13/source/issues/298 --- Tactical/Interface Items.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Tactical/Interface Items.cpp b/Tactical/Interface Items.cpp index b021c47a..2a897d88 100644 --- a/Tactical/Interface Items.cpp +++ b/Tactical/Interface Items.cpp @@ -5769,14 +5769,6 @@ void UpdateAttachmentTooltips(OBJECTTYPE *pObject, UINT8 ubStatusIndex) //search primary item launchables.xml usAttachment = Launchable[usLoop][0]; } - - if (usAttachment > 0 && !Item[usAttachment].hiddenaddon && !Item[usAttachment].hiddenattachment && ItemIsLegal(usAttachment)) - { - if (std::find(attachList.begin(), attachList.end(), usAttachment) == attachList.end()) - { - attachList.push_back(usAttachment); - } - } else { //search for launchables made valid by other attachments @@ -5785,11 +5777,22 @@ void UpdateAttachmentTooltips(OBJECTTYPE *pObject, UINT8 ubStatusIndex) while (cnt) { if (Launchable[usLoop][1] == *p && AttachmentSlots[usLoopSlotID].nasAttachmentClass & Item[Launchable[usLoop][0]].nasAttachmentClass) + { usAttachment = Launchable[usLoop][0]; + break; + } cnt--, p++; } } + + if (usAttachment > 0 && !Item[usAttachment].hiddenaddon && !Item[usAttachment].hiddenattachment && ItemIsLegal(usAttachment)) + { + if (std::find(attachList.begin(), attachList.end(), usAttachment) == attachList.end()) + { + attachList.push_back(usAttachment); + } + } } // check all attachments