From 08c1862887c767ef0f049c4e86732ebb3732f37d Mon Sep 17 00:00:00 2001 From: FutureRave Date: Sat, 4 Feb 2023 17:40:11 +0000 Subject: [PATCH] [Assets]: Save dump of clip map correctly --- src/Components/Modules/AssetInterfaces/IclipMap_t.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Components/Modules/AssetInterfaces/IclipMap_t.cpp b/src/Components/Modules/AssetInterfaces/IclipMap_t.cpp index 557eeb8b..2a3c0814 100644 --- a/src/Components/Modules/AssetInterfaces/IclipMap_t.cpp +++ b/src/Components/Modules/AssetInterfaces/IclipMap_t.cpp @@ -2180,7 +2180,9 @@ namespace Assets // Write to disk constexpr auto* prefix = "maps/mp/"; constexpr auto* suffix = ".d3dbsp"; - Utils::IO::WriteFile(std::format("raw/clipmap/{}{}{}.iw4x.json", prefix, header.clipMap->name, suffix), output.dump(4)); + std::string basename(header.clipMap->name); + basename = basename.substr(std::strlen(prefix), basename.size() - std::strlen(suffix) - std::strlen(prefix)); + Utils::IO::WriteFile(std::format("raw/clipmap/{}.iw4x.json", basename), output.dump(4)); } }