Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando-A-Rocha committed Jul 31, 2024
1 parent f52bf85 commit 11d3cc5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion newmodels_reborn/core/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ local function loadModels()
dff = info.dff,
txd = info.txd,
col = info.col,
name = info.name or getVehicleNameFromModel(baseModel)
name = info.name or "Unnamed"
}
end
end
Expand Down
File renamed without changes.
File renamed without changes.
13 changes: 4 additions & 9 deletions newmodels_reborn/optional/c_testing.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,10 @@ local function pairsByKeys(t)
end

local function getElementCustomModelString(element)
local customModel = tonumber(getElementData(element, getCustomModelDataKey("vehicle")))
local customModel = tonumber(getElementData(element, getCustomModelDataKey(element)))
if customModel and customModels[customModel] then
local name, baseModel = customModels[customModel].name, customModels[customModel].baseModel
if name then
return ("%d \"%s\" (%d)"):format(customModel, name, baseModel)
else
return ("%d (%d)"):format(customModel, baseModel)
end
return ("%d \"%s\" (%d)"):format(customModel, name, baseModel)
else
return ("%d"):format(getElementModel(element))
end
Expand All @@ -59,9 +55,7 @@ end
local function updateDebugViewInfo()
local loadedModelsStr = ""
for customModel, v in pairsByKeys(loadedModels) do
local str
if v.name then str = ("%d \"%s\" (%d)"):format(customModel, v.name, v.baseModel)
else str = ("%d (%d)"):format(customModel, v.baseModel) end
local str = ("%d \"%s\" (%d)"):format(customModel, v.name, v.baseModel)
if loadedModelsStr == "" then
loadedModelsStr = str
else
Expand Down Expand Up @@ -106,6 +100,7 @@ local function toggleDebugView(cmd)
addEventHandler("onClientRender", root, drawDebug, false)
else
if debugTimer and isTimer(debugTimer) then killTimer(debugTimer); debugTimer = nil end
streamedElements = {}
removeEventHandler("onClientRender", root, drawDebug)
end
enabled = not enabled
Expand Down

0 comments on commit 11d3cc5

Please sign in to comment.