1
0
mirror of synced 2025-01-18 22:24:04 +01:00

Get rid of unnecessary length calls.

This commit is contained in:
Jennifer Taylor 2021-05-29 22:10:08 +00:00
parent 161544e612
commit 0f160e9663
2 changed files with 2 additions and 2 deletions

View File

@ -182,7 +182,7 @@ class Shape:
if mode != 4:
raise Exception("Unexpected mode in GE2D structure!")
if (flags & 0x2) and len(labels) == 0:
if (flags & 0x2) and not labels:
raise Exception("GE2D structure has a texture, but no region labels present!")
if (flags & 0x2) and (tex1 == 0xFF):
raise Exception("GE2D structure requests a texture, but no texture pointer present!")

View File

@ -23,7 +23,7 @@ def pad(data: bytes, length: int) -> bytes:
def descramble_text(text: bytes, obfuscated: bool) -> str:
if len(text):
if text:
if obfuscated and (text[0] - 0x20) > 0x7F:
# Gotta do a weird demangling where we swap the
# top bit.