From a7afc4fbb539e9f8deeb2a9c15438fb81c4d4247 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 2 Jun 2022 14:31:23 -0400 Subject: [PATCH] fix infinite loop chain again --- qbsp/map.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/qbsp/map.cc b/qbsp/map.cc index 063439c2..99c122c8 100644 --- a/qbsp/map.cc +++ b/qbsp/map.cc @@ -230,21 +230,21 @@ int FindMiptex(const char *name, std::optional &extended_inf // recursively load animated textures until we loop back to us while (true) { - // looped back - if (wal->animation == name) - break; + // wal for next chain + wal = LoadWal(wal->animation.c_str()); // texinfo base for animated wal std::optional animation_info = extended_info; animation_info->animation = wal->animation; // fetch animation chain - int next_i = FindMiptex(wal->animation.data(), animation_info, internal, false); + int next_i = FindMiptex(wal->name.data(), animation_info, internal, false); map.miptex[last_i].animation_miptex = next_i; last_i = next_i; - // wal for next chain - wal = LoadWal(wal->animation.c_str()); + // looped back + if (wal->animation == name) + break; } } }