Fixed bug specific to socketed misc items

Custom Tome of TP I have that has socket flag set and game still works
This fix allows socketing of non armor or weapon items (as in original game)
This commit is contained in:
Collin Smith 2020-08-19 18:13:04 -07:00
parent 3c56558e9c
commit 8506cc4324
2 changed files with 2 additions and 4 deletions

View File

@ -214,8 +214,7 @@ public class ItemReader {
}
private static boolean readSockets(BitInput bits, Item item) {
boolean hasSockets = (item.flags & Item.ITEMFLAG_SOCKETED) == Item.ITEMFLAG_SOCKETED
&& (item.type.is(Type.ARMO) || item.type.is(Type.WEAP));
boolean hasSockets = (item.flags & Item.ITEMFLAG_SOCKETED) == Item.ITEMFLAG_SOCKETED;
if (hasSockets) {
int item_numsockets = item.props.base().read(Stat.item_numsockets, bits);
item.sockets = new Array<>(item_numsockets);

View File

@ -182,8 +182,7 @@ public class ItemWriter {
}
private static boolean writeSockets(Item item, BitOutput bits) {
boolean hasSockets = (item.flags & Item.ITEMFLAG_SOCKETED) == Item.ITEMFLAG_SOCKETED
&& (item.type.is(Type.ARMO) || item.type.is(Type.WEAP));
boolean hasSockets = (item.flags & Item.ITEMFLAG_SOCKETED) == Item.ITEMFLAG_SOCKETED;
if (hasSockets) {
item.props.base().write(Stat.item_numsockets, bits);
}