script_loading: fix bug

This commit is contained in:
Diavolo 2023-02-26 17:03:12 +01:00
parent 695599679f
commit d4f5440772
No known key found for this signature in database
GPG Key ID: FA77F074E98D98A5

View File

@ -61,7 +61,8 @@ namespace gsc
console::info("Decompiling scriptfile '%s'\n", real_name.data()); console::info("Decompiling scriptfile '%s'\n", real_name.data());
const std::string stack{ script_file->buffer, static_cast<std::uint32_t>(script_file->len) }; const auto len = script_file->compressedLen ? script_file->compressedLen : script_file->len;
const std::string stack{ script_file->buffer, static_cast<std::uint32_t>(len) };
const auto decompressed_stack = utils::compression::zlib::decompress(stack); const auto decompressed_stack = utils::compression::zlib::decompress(stack);
std::vector<std::uint8_t> stack_data; std::vector<std::uint8_t> stack_data;