From ade89f6b8b2a309313ff9b474f0f09417c0bfced Mon Sep 17 00:00:00 2001 From: MegaMech <7255464+MegaMech@users.noreply.github.com> Date: Sat, 26 Apr 2025 20:29:45 -0600 Subject: [PATCH] Remove minimap from Course::from_json and to_json --- src/engine/courses/Course.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/engine/courses/Course.h b/src/engine/courses/Course.h index af1fc48ef..b1f88d217 100644 --- a/src/engine/courses/Course.h +++ b/src/engine/courses/Course.h @@ -82,14 +82,12 @@ typedef struct Properties { #ifdef __cplusplus nlohmann::json to_json() const { nlohmann::json j; - j["Id"] = Id ? Id : ""; + // j["Id"] = Id ? Id : ""; j["Name"] = Name ? Name : ""; j["DebugName"] = DebugName ? DebugName : ""; j["CourseLength"] = CourseLength ? CourseLength : ""; j["AIBehaviour"] = AIBehaviour ? AIBehaviour : ""; - j["MinimapTexture"] = MinimapTexture ? MinimapTexture : ""; j["LakituTowType"] = LakituTowType; - j["MinimapDimensions"] = {MinimapDimensions.X, MinimapDimensions.Z}; j["AIMaximumSeparation"] = AIMaximumSeparation; j["AIMinimumSeparation"] = AIMinimumSeparation; j["NearPersp"] = NearPersp; @@ -129,7 +127,7 @@ typedef struct Properties { // Function to load struct from JSON void from_json(const nlohmann::json& j) { - Id = j.at("Id").get().c_str(); + //Id = j.at("Id").get().c_str(); // Name = j.at("Name").get().c_str(); strncpy(Name, j.at("Name").get().c_str(), sizeof(Name) - 1); Name[sizeof(Name) - 1] = '\0'; // Ensure null termination @@ -143,10 +141,7 @@ typedef struct Properties { CourseLength[sizeof(CourseLength) - 1] = '\0'; // Ensure null termination AIBehaviour = j.at("AIBehaviour").get().c_str(); - MinimapTexture = j.at("MinimapTexture").get().c_str(); LakituTowType = j.at("LakituTowType").get(); - MinimapDimensions.X = j.at("MinimapDimensions")[0].get(); - MinimapDimensions.Z = j.at("MinimapDimensions")[1].get(); AIMaximumSeparation = j.at("AIMaximumSeparation").get(); AIMinimumSeparation = j.at("AIMinimumSeparation").get(); @@ -196,7 +191,7 @@ typedef struct Properties { MinimapFinishlineY = j.at("MinimapFinishlineY").get(); //textures = nullptr; // Deserialize textures if present Sequence = static_cast(j.at("Sequence").get()); - WaterLevel = static_cast(j.at("WaterLevel").get()); + WaterLevel = j.at("WaterLevel").get(); } void SetText(char* name, const char* title, size_t bufferSize) { // Copy the title into the name buffer, ensuring it's null-terminated and within bounds