From ee9039e6756b80bbb15658a47f758f8456c0149c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caner=20K=C4=B1l=C4=B1=C3=A7o=C4=9Flu?= Date: Fri, 29 May 2026 20:09:54 +0300 Subject: [PATCH] add NAME.PREFIX and NAME.SUFFIX support to addItemName Apply NAME.PREFIX and NAME.SUFFIX key lookups in addItemName, matching the existing behaviour in addCharName. Previously, setting these keys on an item had no effect on the singleclick label. Also removes the duplicate Str_CopyLimitNull call that was overwriting the assembled string. --- Changelog.txt | 3 +++ src/game/clients/CClientMsg.cpp | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index 782504276..aac1b40c7 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -4141,3 +4141,6 @@ When setting a property like MORE to the a spell or skill defname, trying to rea 19-05-2026, nightNR - Fixed: pre-AOS armor rating (AR) calculation (#1550). - Fixed NPCs can't cast spells from spellbook after respawn (#1551). + +29-05-2026, canerksk +- Added: NAME.PREFIX and NAME.SUFFIX support for items in addItemName, matching existing addCharName behaviour. \ No newline at end of file diff --git a/src/game/clients/CClientMsg.cpp b/src/game/clients/CClientMsg.cpp index 80e81ad30..3011dc9ed 100644 --- a/src/game/clients/CClientMsg.cpp +++ b/src/game/clients/CClientMsg.cpp @@ -1223,7 +1223,13 @@ void CClient::addItemName( CItem * pItem ) lpctstr pszNameFull = pItem->GetNameFull( fIdentified ); tchar szName[ MAX_ITEM_NAME_SIZE * 2 ]; - size_t len = Str_CopyLimitNull( szName, pszNameFull, ARRAY_COUNT(szName) ); + + Str_CopyLimitNull(szName, pItem->GetKeyStr("NAME.PREFIX"), ARRAY_COUNT(szName)); + Str_ConcatLimitNull(szName, pszNameFull, ARRAY_COUNT(szName)); + Str_ConcatLimitNull(szName, pItem->GetKeyStr("NAME.SUFFIX"), ARRAY_COUNT(szName)); + + //size_t len = Str_CopyLimitNull( szName, pszNameFull, ARRAY_COUNT(szName) ); + size_t len = strlen(szName); const CContainer* pCont = dynamic_cast(pItem); if ( pCont != nullptr )