From fd9d3b212562cfb1e262dd0ee359f3e8baa7966a Mon Sep 17 00:00:00 2001 From: DavideRei <118212274+DavideRei@users.noreply.github.com> Date: Sun, 29 Dec 2024 10:33:48 +0100 Subject: [PATCH] Reset Link when set empty --- src/game/items/CItem.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/game/items/CItem.cpp b/src/game/items/CItem.cpp index fba785497..ebf524cd0 100644 --- a/src/game/items/CItem.cpp +++ b/src/game/items/CItem.cpp @@ -3342,7 +3342,17 @@ bool CItem::r_LoadVal( CScript & s ) // Load an item Script SetUnkZ( s.GetArgCVal() ); // GetEquipLayer() break; case IC_LINK: - m_uidLink.SetObjUID(s.GetArgDWVal()); + { + CUID uidLink = (CUID)s.GetArgDWVal(); + if ((dword)uidLink == 0) + { + m_uidLink.InitUID(); + } + else + { + m_uidLink.SetObjUID(uidLink); + } + } break; case IC_FRUIT: // m_more2