deprecate invalid kittypes

This commit is contained in:
ThatGamerBlue
2021-05-17 06:27:50 +01:00
parent 829f0b134b
commit 7eb96d606a
3 changed files with 14 additions and 1 deletions

View File

@@ -27,7 +27,7 @@ object ProjectVersions {
const val launcherVersion = "2.2.0"
const val rlVersion = "1.7.7"
const val openosrsVersion = "4.6.1"
const val openosrsVersion = "4.6.2"
const val rsversion = 195
const val cacheversion = 165

View File

@@ -51,7 +51,10 @@ public enum KitType
HANDS("Hands"),
BOOTS("Boots"),
JAW("Jaw"),
// When removing these, make sure you also remove the type.ordinal() > 11 checks in RSPlayerCompositionMixin
@Deprecated(since = "4.6.2", forRemoval = true)
RING("Ring"),
@Deprecated(since = "4.6.2", forRemoval = true)
AMMUNITION("Ammo");
private final String name;

View File

@@ -12,6 +12,11 @@ public abstract class RSPlayerCompositionMixin implements RSPlayerComposition
@Override
public int getEquipmentId(KitType type)
{
if (type.ordinal() > 11)
{
return -1;
}
int id = getEquipmentIds()[type.getIndex()];
if (id < 512)
{
@@ -24,6 +29,11 @@ public abstract class RSPlayerCompositionMixin implements RSPlayerComposition
@Override
public int getKitId(KitType type)
{
if (type.ordinal() > 11)
{
return -1;
}
int id = getEquipmentIds()[type.getIndex()];
if (id < 256 || id >= 512)
{