From a90302f09f9b7da47e090ea3344a27fa31a0b984 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sat, 8 Jul 2023 22:45:35 +0200 Subject: [PATCH] Allow loading RSON files by path ID --- r5dev/vpc/rson.cpp | 4 ++-- r5dev/vpc/rson.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/r5dev/vpc/rson.cpp b/r5dev/vpc/rson.cpp index 0efe046f..adb7f76b 100644 --- a/r5dev/vpc/rson.cpp +++ b/r5dev/vpc/rson.cpp @@ -9,9 +9,9 @@ RSON::Node_t* RSON::LoadFromBuffer(const char* pszBufferName, char* pBuffer, RSO return RSON_LoadFromBuffer(pszBufferName, pBuffer, rootType, 0, NULL); } -RSON::Node_t* RSON::LoadFromFile(const char* pszFilePath) +RSON::Node_t* RSON::LoadFromFile(const char* pszFilePath, const char* pPathID) { - if (FileSystem()->FileExists(pszFilePath, "GAME")) + if (FileSystem()->FileExists(pszFilePath, pPathID)) { FileHandle_t file = FileSystem()->Open(pszFilePath, "rt"); diff --git a/r5dev/vpc/rson.h b/r5dev/vpc/rson.h index 19f980b3..cbba16d8 100644 --- a/r5dev/vpc/rson.h +++ b/r5dev/vpc/rson.h @@ -81,7 +81,7 @@ public: public: static Node_t* LoadFromBuffer(const char* pszBufferName, char* pBuffer, eFieldType rootType); - static Node_t* LoadFromFile(const char* pszFilePath); + static Node_t* LoadFromFile(const char* pszFilePath, const char* pPathID = nullptr); }; /////////////////////////////////////////////////////////////////////////////// inline CMemory p_RSON_LoadFromBuffer;