From 7b59aab6dbcbf87f73b7447b91658e54953c6519 Mon Sep 17 00:00:00 2001 From: Jorijn van der Graaf Date: Sat, 24 May 2025 00:50:34 +0200 Subject: [PATCH] hotfix --- Crafter.Asset-Asset.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Crafter.Asset-Asset.cpp b/Crafter.Asset-Asset.cpp index d93badf..7cae7df 100644 --- a/Crafter.Asset-Asset.cpp +++ b/Crafter.Asset-Asset.cpp @@ -62,7 +62,7 @@ AssetLoad::AssetLoad(fs::path path) : f(path, std::ios::binary) { entries[i].offset = header.offset; headerLength+=header.nameLenght + header.typeLenght; } - headerLength = sizeof(std::uint32_t)*2 + (sizeof(std::uint32_t)*4*entryCount); + headerLength += sizeof(std::uint32_t)*2 + (sizeof(std::uint32_t)*4*entryCount); } std::vector AssetLoad::Load(std::string_view name) { @@ -117,18 +117,18 @@ void AssetLoad::Load(const AssetEntry& entry, void* data, uint32_t lenght) { } std::vector AssetLoad::LoadOffset(uint32_t offset, uint32_t lenght) { - f.seekg(offset+headerLength); + f.seekg(offset+headerLength, std::ios_base::beg); std::vector vector(lenght); f.read(vector.data(), lenght); return vector; } void AssetLoad::LoadOffset(uint32_t offset, uint32_t lenght, void* data) { - f.seekg(offset+headerLength); + f.seekg(offset+headerLength, std::ios_base::beg); f.read(reinterpret_cast(data), lenght); } std::vector AssetLoad::LoadAll() { - f.seekg(headerLength); + f.seekg(headerLength, std::ios_base::beg); return std::vector((std::istreambuf_iterator(f)), std::istreambuf_iterator()); }