Fix 'NotInInventory' ignoring HQ items
authorLiza Carvelli <liza@carvel.li>
Tue, 1 Oct 2024 20:05:21 +0000 (22:05 +0200)
committerLiza Carvelli <liza@carvel.li>
Tue, 1 Oct 2024 20:05:21 +0000 (22:05 +0200)
QuestPaths/6.x - Endwalker/Class Quests/SGE/4068_Sage's Focus.json
Questionable/Controller/Steps/Interactions/EquipItem.cs
Questionable/Controller/Steps/Shared/SkipCondition.cs

index 5c731ab81908dcc30c7c258d7fec4e532e1a3d0b..18fbc7da7d9d3ee3b0d228535502b143b259a7d2 100644 (file)
           "TerritoryId": 134,
           "InteractionType": "EquipItem",
           "ItemId": 35778,
-          "AetheryteShortcut": "Middle La Noscea - Summerford Farms",
-          "Fly": true,
           "Comment": "Try to Equip Stonegold Milpreves",
           "SkipConditions": {
-            "AetheryteShortcutIf": {
-              "InSameTerritory": true
-            },
             "StepIf": {
               "Item": {
                 "NotInInventory": true
           },
           "StopDistance": 5,
           "TerritoryId": 134,
-          "InteractionType": "AcceptQuest",
-          "AetheryteShortcut": "Middle La Noscea - Summerford Farms",
-          "Fly": true,
-          "SkipConditions": {
-            "AetheryteShortcutIf": {
-              "InSameTerritory": true
-            }
-          }
+          "InteractionType": "AcceptQuest"
         }
       ]
     },
index 9e424f65204af50854d3a0bf5501bafd4d030ead..c8159247f5c686ac830dbf738943fede07de18df 100644 (file)
@@ -158,6 +158,8 @@ internal static class EquipItem
                     return;
                 }
             }
+
+            throw new TaskException($"Could not equip item {Task.ItemId}.");
         }
 
         private static List<ushort>? GetEquipSlot(Item item)
index 9690d4740184963cd2f2b04f203257a5e2e5a018..c95ee8eabfe0197b88bcf392a2a36e68301cc9e7 100644 (file)
@@ -144,7 +144,8 @@ internal static class SkipCondition
             if (skipConditions.Item is { NotInInventory: true } && step is { ItemId: not null })
             {
                 InventoryManager* inventoryManager = InventoryManager.Instance();
-                if (inventoryManager->GetInventoryItemCount(step.ItemId.Value) == 0)
+                if (inventoryManager->GetInventoryItemCount(step.ItemId.Value) == 0 &&
+                    inventoryManager->GetInventoryItemCount(step.ItemId.Value, true) == 0)
                 {
                     logger.LogInformation("Skipping step, no item with itemId {ItemId} in inventory",
                         step.ItemId.Value);