Skip to content

Commit

Permalink
add laeIdleProj02.col fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando-A-Rocha committed Jun 25, 2024
1 parent 91fb08d commit ca48536
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions [gameplay]/mapfixes/meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
<setting name="*atrium_lobby_interior" value="true" friendlyname="Enable Atrium lobby entrance open-world interior map" accept="true,false"/>
<setting name="*garage_doherty_interior" value="true" friendlyname="Enable Doherty Safehouse Garage open-world interior map" accept="true,false"/>
<setting name="*nodamage_crackfactory_interior" value="true" friendlyname="Enable Undamaged SF Crack Factory open-world interior map" accept="true,false"/>
<setting name="*laeIdleProj02" value="true" friendlyname="Enable laeIdleProj02.dff (Idlewood) Buildings collision fix" accept="true,false"/>
</settings>

<file src="models/laeIdleProj02.col"/>
</meta>
3 changes: 3 additions & 0 deletions [gameplay]/mapfixes/models/CREDITS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Credits of the modified game models contained in this folder:

- laeIdleProj02.col: Optimized and fixed collision created by THEGizmo
Binary file added [gameplay]/mapfixes/models/laeIdleProj02.col
Binary file not shown.
21 changes: 21 additions & 0 deletions [gameplay]/mapfixes/scripts/client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions [gameplay]/mapfixes/scripts/server/data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
},
}
}

0 comments on commit ca48536

Please sign in to comment.