From a45b1ca6376e87db976334afe710dea9e6862956 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 7 Dec 2019 11:48:41 +0100 Subject: [PATCH] - fixed anim loading in Shadow Warrior. --- source/sw/src/anim.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/sw/src/anim.cpp b/source/sw/src/anim.cpp index 37fafd322..de3e0e216 100644 --- a/source/sw/src/anim.cpp +++ b/source/sw/src/anim.cpp @@ -240,13 +240,16 @@ unsigned char *LoadAnm(short anim_num, int *lengthp) ANIMnum = anim_num; // lock it - + + int file = fileSystem.FindFile(ANIMname[ANIMnum]); + if (file < 0) return nullptr; + *lengthp = length = fileSystem.FileLength(file); + if (anm_ptr[anim_num] == 0) { - auto handle = fileSystem.OpenFileReader(ANIMname[ANIMnum], 0); + auto handle = fileSystem.OpenFileReader(file); if (!handle.isOpen()) return NULL; - *lengthp = length = handle.GetLength(); buffer.Resize(length + sizeof(anim_t)); anm_ptr[anim_num] = (anim_t*)buffer.Data();