Added method to validate flags for gem stat lists

This commit is contained in:
Collin Smith
2020-09-06 00:17:25 -07:00
parent 57e1052e9f
commit 49f293c494
2 changed files with 9 additions and 0 deletions

View File

@ -22,6 +22,11 @@ public class AttributesUpdater {
if (setItemListCount > 1) {
log.warnf("listFlags(0x%x) contains more than 1 set list", listFlags);
}
} else {
final int gemListCount = StatListFlags.countGemFlags(listFlags);
if (gemListCount > 1) {
log.warnf("listFlags(0x%x) contains more than 1 gem list", listFlags);
}
}
final StatList list = attrs.list();

View File

@ -95,5 +95,9 @@ public class StatListFlags {
}
}
static int countGemFlags(int flags) {
return Integer.bitCount(flags);
}
private StatListFlags() {}
}