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