fix: Fixes bug with naming item back to default (#2331)

This commit is contained in:
Kamron Batman 2026-02-08 21:12:57 -08:00 committed by GitHub
parent f7f1265216
commit 10f26c387e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -599,19 +599,19 @@ public partial class Item : IHued, IComparable<Item>, ISpawnable, IObjectPropert
get => LookupCompactInfo()?.m_Name ?? DefaultName;
set
{
if (value == null || value != DefaultName)
var info = LookupCompactInfo();
if (value == null || value == DefaultName)
{
var info = AcquireCompactInfo();
info.m_Name = value;
if (info.m_Name == null)
{
VerifyCompactInfo();
}
InvalidateProperties();
info?.m_Name = null;
VerifyCompactInfo();
}
else
{
(info ?? AcquireCompactInfo()).m_Name = value;
}
InvalidateProperties();
}
}