diff options
-rw-r--r-- | src/gfxinit.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gfxinit.cpp b/src/gfxinit.cpp index c6b725514..9dad75aa3 100644 --- a/src/gfxinit.cpp +++ b/src/gfxinit.cpp @@ -467,8 +467,10 @@ bool OBGFileScanner::AddFile(const char *filename, size_t basepath_length) if (duplicate) { delete graphics; } else { - graphics->next = _available_graphics_sets; - _available_graphics_sets = graphics; + GraphicsSet **last = &_available_graphics_sets; + while (*last != NULL) last = &(*last)->next; + + *last = graphics; ret = true; } } else { |