Skip to content

Commit aac7fac

Browse files
fix edfCreateBasic editorMode
1 parent 9588192 commit aac7fac

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

[editor]/edf/edf.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ end
2525

2626
-- basic element create functions table (cdata holds creation parameters)
2727
local edfCreateBasic = {
28-
object = function(cdata)
28+
object = function(cdata, editorMode)
2929
local object = createObject(cdata.model, cdata.position[1], cdata.position[2], cdata.position[3], cdata.rotation[1], cdata.rotation[2], cdata.rotation[3])
3030
setObjectScale(object, cdata.scale)
31-
if exports.editor_main:getMapSettingValue("useLODs") == true then
31+
-- Create object's LOD if editing a map in Map Editor & LODs are enabled in the map's settings
32+
if editorMode and exports.editor_main:getMapSettingValue("useLODs") then
3233
local lodModel = exports.editor_main:getLODModelFromObjectModel(cdata.model)
3334
if lodModel then
3435
local lodObject = createObject(lodModel, cdata.position[1], cdata.position[2], cdata.position[3], cdata.rotation[1], cdata.rotation[2], cdata.rotation[3], true)
@@ -507,7 +508,7 @@ function edfRepresentElement(theElement, resource, parentData, editorMode, restr
507508
end
508509

509510
-- create our basic element
510-
component = edfCreateBasic[definedChild.type](childData)
511+
component = edfCreateBasic[definedChild.type](childData, editorMode)
511512

512513
componentHandle = component
513514

@@ -605,7 +606,7 @@ function edfCreateElement(elementType, creatorClient, fromResource, parametersTa
605606
childData[property] = parametersTable[property] or propertyData.default
606607
end
607608

608-
theElement = edfCreateBasic[elementType](childData)
609+
theElement = edfCreateBasic[elementType](childData, editorMode)
609610

610611
setElementInterior(theElement, parametersTable.interior)
611612
setElementDimension(theElement, parametersTable.dimension)

0 commit comments

Comments
 (0)