Fixed deserialization bug and appended additional fields to Item#toString

This commit is contained in:
Collin Smith 2020-07-18 02:39:52 -07:00
parent 47d96abde4
commit b6c21abbf7
2 changed files with 13 additions and 1 deletions

View File

@ -402,6 +402,18 @@ public class Item {
.append("storeLoc", storeLoc)
.append("gridX", gridX)
.append("gridY", gridY)
.append("socketsFilled", socketsFilled)
.append("id", String.format("0x%08X", (int) id))
.append("ilvl", ilvl)
.append("quality", quality)
.append("pictureId", pictureId)
.append("classOnly", String.format("0x%04X", classOnly))
.append("qualityId", String.format("0x%08X", qualityId))
.append("qualityData", qualityData)
.append("runewordData", String.format("0x%04X", runewordData))
.append("inscription", inscription)
.append("sockets", sockets)
.append("attrs", Arrays.toString(stats))
;
} else {
builder.append("location", location);

View File

@ -160,7 +160,7 @@ public class ItemSerializer {
}
private static boolean readSockets(BitStream bitStream, Item item) {
boolean hasSockets = (item.flags * Item.ITEMFLAG_SOCKETED) == Item.ITEMFLAG_SOCKETED
boolean hasSockets = (item.flags & Item.ITEMFLAG_SOCKETED) == Item.ITEMFLAG_SOCKETED
&& (item.type.is(Type.ARMO) || item.type.is(Type.WEAP));
if (hasSockets) {
int item_numsockets = item.attrs.base().read(Stat.item_numsockets, bitStream);