From 2fb27f9fea2d65b66e668c710e8ed59982451f42 Mon Sep 17 00:00:00 2001 From: morfidon <57798071+morfidon@users.noreply.github.com> Date: Thu, 12 Mar 2026 08:04:29 +0100 Subject: [PATCH] Rename inventory Na-Krul combine path Rename the inventory-insert combine helper to clarify that it runs after an item is inserted into InvList. This keeps the separate flow-specific entry point but makes its purpose clearer during review. --- Source/inv.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/inv.cpp b/Source/inv.cpp index 2c0fa5f53..0d654973b 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -175,7 +175,7 @@ std::array<_item_indexes, 2> GetOtherNaKrulNotes(_item_indexes preservedNoteId) } } -int TryCombineInsertedNaKrulNote(Player &player, int insertedInvIndex) +int TryCombineNaKrulNoteAfterInventoryInsert(Player &player, int insertedInvIndex) { if (insertedInvIndex < 0 || insertedInvIndex >= player._pNumInv) { return insertedInvIndex; @@ -575,7 +575,7 @@ bool ChangeInvItem(Player &player, int slot, Size itemSize) if (prevItemId == 0) { player.InvList[player._pNumInv] = player.HoldItem.pop(); player._pNumInv++; - prevItemId = TryCombineInsertedNaKrulNote(player, player._pNumInv - 1) + 1; + prevItemId = TryCombineNaKrulNoteAfterInventoryInsert(player, player._pNumInv - 1) + 1; } else { const int invIndex = prevItemId - 1; if (player.HoldItem._itype == ItemType::Gold) @@ -589,7 +589,7 @@ bool ChangeInvItem(Player &player, int slot, Size itemSize) if (itemIndex == -prevItemId) itemIndex = 0; } - prevItemId = TryCombineInsertedNaKrulNote(player, invIndex) + 1; + prevItemId = TryCombineNaKrulNoteAfterInventoryInsert(player, invIndex) + 1; } itemSize = GetInventorySize(player.InvList[prevItemId - 1]); @@ -1470,7 +1470,7 @@ bool AutoPlaceItemInInventory(Player &player, const Item &item, bool sendNetwork player._pNumInv++; int invIndex = player._pNumInv - 1; if (semantics == InventoryInsertSemantics::PlayerAction) { - invIndex = TryCombineInsertedNaKrulNote(player, invIndex); + invIndex = TryCombineNaKrulNoteAfterInventoryInsert(player, invIndex); } AddItemToInvGrid(player, *targetSlot, invIndex + 1, GetInventorySize(player.InvList[invIndex]), sendNetworkMessage);