Fix passing unsigned longs to TAG_Long, which requires signed longs

This commit is contained in:
David Vierra 2016-08-08 17:25:20 -10:00
parent 07edbc8798
commit 78b6ebf9eb

View File

@ -119,11 +119,16 @@ class NBTUUIDAttr(object):
least = uuidInt & 0xffffffffffffffffL
most = (uuidInt >> 64) & 0xffffffffffffffffL
tag = instance.rootTag
tag["UUIDLeast"].value = least
tag["UUIDMost"].value = most
tag["UUIDLeast"].value = _signed(least)
tag["UUIDMost"].value = _signed(most)
instance.dirty = True
def _signed(bits):
if bits >= (1 << 63):
bits -= (1 << 64)
return bits
class NBTCompoundRef(object):
def __init__(self, rootTag, parent):
"""