From 650ff2db724e41a6ea42d5bcb08e96caac91a2f2 Mon Sep 17 00:00:00 2001 From: xThrasherrr Date: Sun, 4 Oct 2026 19:30:30 -0600 Subject: [PATCH] Accept a byte-order mark in reskate-levels.json The launcher and the server already skip one, so a map saved with a BOM was listed everywhere but left out in game. --- Engine/Game/World/custom_level_manifest.cpp | 4 ++-- Engine/Game/World/custom_level_manifest.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Engine/Game/World/custom_level_manifest.cpp b/Engine/Game/World/custom_level_manifest.cpp index fb87f2a..782b0d2 100644 --- a/Engine/Game/World/custom_level_manifest.cpp +++ b/Engine/Game/World/custom_level_manifest.cpp @@ -86,9 +86,9 @@ void exact_fields(const Json& object, std::initializer_list ex CustomLevelManifest parse(std::string_view text) { if (text.size() > custom_level_manifest_max_bytes) throw std::runtime_error("custom-level manifest exceeds 64 KiB"); - if (text.starts_with("\xef\xbb\xbf")) - throw std::runtime_error("custom-level manifest must not contain a UTF-8 BOM"); + // Json::parse skips a byte-order mark, which several Windows editors still + // write. The launcher and the server accept one, so the game must too. const auto root = Json::parse(text, JsonLimits{ custom_level_manifest_max_bytes, 8, 8192}); exact_fields(root, {"schema", "levels"}, "custom-level manifest"); diff --git a/Engine/Game/World/custom_level_manifest.h b/Engine/Game/World/custom_level_manifest.h index 759a737..1ac866b 100644 --- a/Engine/Game/World/custom_level_manifest.h +++ b/Engine/Game/World/custom_level_manifest.h @@ -23,7 +23,7 @@ struct CustomLevelManifest { std::string issue; }; -// Parse the Studio-authored Patch/dingosdk-levels.json contract. Invalid input +// Parse a mod's or the Patch folder's reskate-levels.json. Invalid input // fails closed: no partial set of destinations is returned. CustomLevelManifest parse_custom_level_manifest(std::string_view text) noexcept; CustomLevelManifest read_custom_level_manifest(const std::filesystem::path& path) noexcept;