From 7186f411bb61f2d11fa6d6ea738f99411adc17de Mon Sep 17 00:00:00 2001 From: Jonathan Date: Wed, 1 Nov 2023 20:14:36 -0400 Subject: [PATCH] fix animation infinite loops --- qbsp/map.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qbsp/map.cc b/qbsp/map.cc index d2a3a167..0b64e97a 100644 --- a/qbsp/map.cc +++ b/qbsp/map.cc @@ -494,6 +494,9 @@ int FindMiptex(const char *name, std::optional &extended_inf // recursively load animated textures until we loop back to us while (true) { + if (wal->animation.empty()) + break; + // wal for next chain wal = map.load_image_meta(wal->animation.c_str()); @@ -511,7 +514,7 @@ int FindMiptex(const char *name, std::optional &extended_inf last_i = next_i; // looped back - if (!Q_strcasecmp(wal->animation.c_str(), name)) + if (!Q_strcasecmp(wal->animation.c_str(), name) || last_i == next_i) break; }