diff --git a/[gameplay]/mapfixes/meta.xml b/[gameplay]/mapfixes/meta.xml index bec04c7a8..4c83b340a 100644 --- a/[gameplay]/mapfixes/meta.xml +++ b/[gameplay]/mapfixes/meta.xml @@ -11,5 +11,8 @@ + + + \ No newline at end of file diff --git a/[gameplay]/mapfixes/models/CREDITS.txt b/[gameplay]/mapfixes/models/CREDITS.txt new file mode 100644 index 000000000..154ca0b12 --- /dev/null +++ b/[gameplay]/mapfixes/models/CREDITS.txt @@ -0,0 +1,3 @@ +Credits of the modified game models contained in this folder: + +- laeIdleProj02.col: Optimized and fixed collision created by THEGizmo diff --git a/[gameplay]/mapfixes/models/laeIdleProj02.col b/[gameplay]/mapfixes/models/laeIdleProj02.col new file mode 100644 index 000000000..589db7193 Binary files /dev/null and b/[gameplay]/mapfixes/models/laeIdleProj02.col differ diff --git a/[gameplay]/mapfixes/scripts/client/main.lua b/[gameplay]/mapfixes/scripts/client/main.lua index 9cb8fcfdb..e2c5d8e10 100644 --- a/[gameplay]/mapfixes/scripts/client/main.lua +++ b/[gameplay]/mapfixes/scripts/client/main.lua @@ -4,6 +4,14 @@ addEvent("mapfixes:client:togOneComponent", true) local mapFixComponents = {} local function loadOneMapFixComponent(name, data) + -- Restore previously replaced models if any + local replaceModels = data.replaceModels + if replaceModels then + for _, v in pairs(replaceModels) do + engineRestoreCOL(v.modelID) + engineRestoreModel(v.modelID) + end + end -- Clear the previous elements if any local createdElements = data.createdElements if createdElements then @@ -42,6 +50,19 @@ local function loadOneMapFixComponent(name, data) return end + -- Replace models if any + if replaceModels then + for _, v in pairs(replaceModels) do + if v.colPath then + local colElement = engineLoadCOL("models/" .. v.colPath) + if colElement then + engineReplaceCOL(colElement, v.modelID) + if not data.createdElements then data.createdElements = {} end + data.createdElements[#data.createdElements + 1] = colElement + end + end + end + end -- Create the new elements if any local spawnBuildings = data.spawnBuildings if spawnBuildings then diff --git a/[gameplay]/mapfixes/scripts/server/data.lua b/[gameplay]/mapfixes/scripts/server/data.lua index 39a614cf4..4f05a1a57 100644 --- a/[gameplay]/mapfixes/scripts/server/data.lua +++ b/[gameplay]/mapfixes/scripts/server/data.lua @@ -78,4 +78,10 @@ mapFixComponents = { {11236, 25, -2164.4531, -255.39062, 38.125}, -- crackfactwalke }, }, + ["laeIdleProj02"] = { + -- Fixes the collision of these apartment complex buildings in Idlewood + replaceModels = { + {modelID=5475, colPath="laeIdleProj02.col"} + }, + } } \ No newline at end of file