Allow partially socketed items to populate Item.Sockets by relaxing the strict socket-count check

Allow partially socketed items to populate Item.Sockets by relaxing the strict socket-count check
This commit is contained in:
2026-01-24 13:56:44 +09:00
committed by guiyomu-dev
parent 0ed5975efc
commit 4d9c6e75cd

View File

@@ -414,7 +414,10 @@ func (gd *GameReader) Inventory(rawPlayerUnits RawPlayerUnits, hover data.HoverD
// Get socket list for this base item
sockets := socketedItemsMap[baseUnitID]
if len(sockets) != numSockets.Value {
if len(sockets) == 0 {
continue
}
if len(sockets) > numSockets.Value {
continue
}
@@ -425,8 +428,8 @@ func (gd *GameReader) Inventory(rawPlayerUnits RawPlayerUnits, hover data.HoverD
})
}
// Validate socket positions and build final list in one pass
baseItem.Sockets = make([]data.Item, 0, numSockets.Value)
// Validate socket positions and build final list in one pass (allow partial sockets)
baseItem.Sockets = make([]data.Item, 0, len(sockets))
for i, socket := range sockets {
if socket.position != i {
baseItem.Sockets = nil // Reset if positions are invalid