fix: wrong if logic! false != -1 is true

This commit is contained in:
əlemi 2023-02-16 18:55:05 +01:00
parent cef2fe19ee
commit 46b10711f9
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -346,7 +346,7 @@ class SlotType(Type):
new_way = ctx._proto > 340 new_way = ctx._proto > 340
check_type = Boolean if new_way else Short check_type = Boolean if new_way else Short
val = check_type.read(buffer, ctx) val = check_type.read(buffer, ctx)
if (new_way and val) or val != -1: if (new_way and val) or (not new_way and val != -1):
if new_way: if new_way:
slot["id"] = VarInt.read(buffer, ctx) slot["id"] = VarInt.read(buffer, ctx)
else: else: