Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4077,3 +4077,7 @@ When setting a property like MORE to the a spell or skill defname, trying to rea
- Changed: Object timers are now saved in worldsave files as TIMERMS, to avoid ambiguity and reliance on git build number to determine if TIMER expressed a number in seconds or milliseconds.
- Changed: Added 5 seconds timeout to DNS hostname resolution at startup (avoid getting stuck when connectivity is enabled but not working).
- Changed: CANMASK formatted in worldsave files as hexadecimal number, instead of decimal.


25-11-2025, canerksk
- Fixed: Fixed the issue where some items (hair, beard, etc.) were counted as items inside the corpse (Issue #1189).
37 changes: 31 additions & 6 deletions src/game/clients/CClientMsg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1226,12 +1226,37 @@ void CClient::addItemName( CItem * pItem )
size_t len = Str_CopyLimitNull( szName, pszNameFull, ARRAY_COUNT(szName) );

const CContainer* pCont = dynamic_cast<const CContainer*>(pItem);
if ( pCont != nullptr )
{
// ??? Corpses show hair as an item !!
len += snprintf( szName+len, sizeof(szName) - len,
g_Cfg.GetDefaultMsg(DEFMSG_CONT_ITEMS), pCont->GetContentCount(), pCont->GetTotalWeight() / WEIGHT_UNITS);
}
if (pCont != nullptr)
{

size_t iContContentTotalUnit = 0;
size_t iContContentTotalWeight = 0;

if (pItem->IsType(IT_CORPSE))
{
for (size_t i = 0; i < pCont->GetContentCount(); ++i)
{
CItem *pContentItem = static_cast<CItem *>(pCont->GetContentIndex(i));
if (pContentItem->IsAttr(ATTR_NEWBIE | ATTR_MOVE_NEVER | ATTR_CURSED2 | ATTR_BLESSED2 | ATTR_STATIC))
continue;

if (pContentItem->IsType(IT_HAIR) || pContentItem->IsType(IT_BEARD))
continue;

++iContContentTotalUnit;
iContContentTotalWeight += static_cast<size_t>(pContentItem->GetWeight() / WEIGHT_UNITS);
}
}
else
{
iContContentTotalUnit = pCont->GetContentCount();
iContContentTotalWeight = pCont->GetTotalWeight() / WEIGHT_UNITS;
}
//g_Log.Event(LOGM_CLIENTS_LOG, "Items=%d, Weight=%d\n", iContContentTotalUnit, iContContentTotalWeight);
// ??? Corpses show hair as an item !!
len += snprintf(szName + len, sizeof(szName) - len, g_Cfg.GetDefaultMsg(DEFMSG_CONT_ITEMS), iContContentTotalUnit, iContContentTotalWeight);
}


// obviously damaged ?
else if ( pItem->IsTypeArmorWeapon())
Expand Down