From a2fda5dbabcbc2140e4c909442f8040306f5c22a Mon Sep 17 00:00:00 2001 From: sruon Date: Thu, 24 Apr 2025 22:22:36 -0600 Subject: [PATCH] Assign new LS item before accessing --- src/map/linkshell.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/map/linkshell.cpp b/src/map/linkshell.cpp index 368921b1552..6216369868b 100644 --- a/src/map/linkshell.cpp +++ b/src/map/linkshell.cpp @@ -196,6 +196,7 @@ void CLinkshell::ChangeMemberRank(const std::string& MemberName, uint8 toSack) uint8 SlotID = PItemLinkshell->getSlotID(); destroy(PItemLinkshell); + PItemLinkshell = newShellItem; PMember->getStorage(LocationID)->InsertItem(PItemLinkshell, SlotID); db::preparedStmt("UPDATE char_inventory SET itemid = ?, extra = ? WHERE charid = ? AND location = ? AND slot = ? LIMIT 1", PItemLinkshell->getID(), PItemLinkshell->m_extra, PMember->id, LocationID, SlotID);