runelite-api: don't allow varbits with MSB<LSB

This commit is contained in:
Adam
2017-11-26 09:59:21 -05:00
parent 6402e16bb5
commit 6b008f9107

View File

@@ -84,7 +84,7 @@ public enum Varbits
/** /**
* Special Attack * Special Attack
*/ */
SPECIAL_ATTACK_PERCENT(300, 31, 0), SPECIAL_ATTACK_PERCENT(300, 0, 16),
SPECIAL_ATTACK_ENABLED(301, 0, 0), SPECIAL_ATTACK_ENABLED(301, 0, 0),
/** /**
@@ -133,6 +133,11 @@ public enum Varbits
private Varbits(int id, int index, int leastSignificantBit, int mostSignificantBit) private Varbits(int id, int index, int leastSignificantBit, int mostSignificantBit)
{ {
if (mostSignificantBit < leastSignificantBit)
{
throw new IllegalStateException("MSB < LSB");
}
this.id = id; this.id = id;
this.index = index; this.index = index;
this.leastSignificantBit = leastSignificantBit; this.leastSignificantBit = leastSignificantBit;