diff --git a/source/duke3d/src/gamevars.cpp b/source/duke3d/src/gamevars.cpp index 54f7c9f49..1c8215a76 100644 --- a/source/duke3d/src/gamevars.cpp +++ b/source/duke3d/src/gamevars.cpp @@ -581,7 +581,10 @@ size_t __fastcall Gv_GetArrayCountFromFile(int const arrayIdx, size_t const file size_t const elementSize = Gv_GetArrayElementSize(arrayIdx); size_t const denominator = min(elementSize, sizeof(uint32_t)); - return (filelength + denominator - 1) / denominator; + + Bassert(denominator); + + return tabledivide64(filelength + denominator - 1, denominator); } int __fastcall Gv_GetArrayValue(int const id, int index)