From 5bc1207d55f017d39226ce859561e4974e80b9f9 Mon Sep 17 00:00:00 2001 From: KubaPro010 Date: Sun, 28 Dec 2025 12:46:14 +0100 Subject: [PATCH] add id --- plugin.lua | 4 +++- scripts/1-rft.lua | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/plugin.lua b/plugin.lua index 32d74e0..9d4684d 100644 --- a/plugin.lua +++ b/plugin.lua @@ -352,6 +352,8 @@ function set_oda_id_data_rds2(oda_id, data) end ---@return integer oda_id function register_oda_rds2(aid, data, file_related) end +---This function is defined externally ---Loads the file into RFT and initializes it if needed, note that this needs RDR2 mode 2 ---@param path string -function load_rft_file(path) end +---@param id integer +function load_rft_file(path, id) end diff --git a/scripts/1-rft.lua b/scripts/1-rft.lua index 9a84111..01f265c 100644 --- a/scripts/1-rft.lua +++ b/scripts/1-rft.lua @@ -34,7 +34,11 @@ local function start_rft() end end -function load_rft_file(path) +---This function is defined externally +---Loads the file into RFT and initializes it if needed, note that this needs RDR2 mode 2 +---@param path string +---@param id integer +function load_rft_file(path, id) local file = io.open(path, "rb") if not file then error("Could not open file") end _Rft_file = file:read("*a") @@ -42,5 +46,5 @@ function load_rft_file(path) if #_Rft_file > 262143 then error("The file is too large", 2) end if _Rft_oda_id == nil then start_rft() end ---@diagnostic disable-next-line: param-type-mismatch - set_oda_id_data_rds2(_Rft_oda_id, #_Rft_file | 0 << 18) + set_oda_id_data_rds2(_Rft_oda_id, #_Rft_file | id << 18) end \ No newline at end of file