missing textures will not crash the game

This commit is contained in:
Anthony Samms
2025-11-21 00:00:09 -05:00
parent 1b4db994a5
commit 5533e27b78

View File

@@ -184,7 +184,7 @@ class TextureWrapper:
finally: finally:
os.unlink(temp_path) os.unlink(temp_path)
else: else:
raise Exception(f"Texture {tex_name} was not found in {zip}") logger.error(f"Texture {tex_name} was not found in {zip}")
logger.info(f"Textures loaded from zip: {zip}") logger.info(f"Textures loaded from zip: {zip}")
except Exception as e: except Exception as e:
logger.error(f"Failed to load textures from zip {zip}: {e}") logger.error(f"Failed to load textures from zip {zip}: {e}")
@@ -227,6 +227,10 @@ class TextureWrapper:
mirror: str, x: float, y: float, x2: float, y2: float, mirror: str, x: float, y: float, x2: float, y2: float,
origin: tuple[float, float], rotation: float, fade: float, origin: tuple[float, float], rotation: float, fade: float,
index: int, src: Optional[tuple[float, float, float, float]], controllable: bool) -> None: index: int, src: Optional[tuple[float, float, float, float]], controllable: bool) -> None:
if subset not in self.textures:
return
if texture not in self.textures[subset]:
return
mirror_x = -1 if mirror == 'horizontal' else 1 mirror_x = -1 if mirror == 'horizontal' else 1
mirror_y = -1 if mirror == 'vertical' else 1 mirror_y = -1 if mirror == 'vertical' else 1
if fade != 1.1: if fade != 1.1: