From 806bb2ba9d1621e2fa56eddac49b207e3d6f5d94 Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Sun, 16 Jun 2019 03:02:04 +0300 Subject: [PATCH] Fix script loading. Forgot to go back to the beginning of the file after reading the header. Bug was introduced in recent changes. --- source/Base/ScriptSrc.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/Base/ScriptSrc.cpp b/source/Base/ScriptSrc.cpp index 4c6997b1..1658a74b 100644 --- a/source/Base/ScriptSrc.cpp +++ b/source/Base/ScriptSrc.cpp @@ -100,6 +100,8 @@ void ScriptSrc::Process() } // Allocate enough space to hold the file data mData.resize(length, 0); + // Go back to the beginning + std::fseek(fp, 0, SEEK_SET); // Read the file contents into allocated data std::fread(&mData[0], 1, length, fp); // Where the last line ended