diff --git a/Source/UnrealEnginePython/Private/UEPyModule.cpp b/Source/UnrealEnginePython/Private/UEPyModule.cpp index 993828a86..9558afc95 100644 --- a/Source/UnrealEnginePython/Private/UEPyModule.cpp +++ b/Source/UnrealEnginePython/Private/UEPyModule.cpp @@ -879,7 +879,10 @@ static PyMethodDef ue_PyUObject_methods[] = { { "get_levels", (PyCFunction)py_ue_get_levels, METH_VARARGS, "" }, { "get_current_level", (PyCFunction)py_ue_get_current_level, METH_VARARGS, "" }, + +#if WITH_EDITORONLY_DATA { "set_current_level", (PyCFunction)py_ue_set_current_level, METH_VARARGS, "" }, +#endif #if WITH_EDITOR { "get_level_script_blueprint", (PyCFunction)py_ue_get_level_script_blueprint, METH_VARARGS, "" }, diff --git a/Source/UnrealEnginePython/Private/UObject/UEPyWorld.cpp b/Source/UnrealEnginePython/Private/UObject/UEPyWorld.cpp index ec2be2b7c..1d903ae36 100644 --- a/Source/UnrealEnginePython/Private/UObject/UEPyWorld.cpp +++ b/Source/UnrealEnginePython/Private/UObject/UEPyWorld.cpp @@ -298,6 +298,7 @@ PyObject *py_ue_get_current_level(ue_PyUObject *self, PyObject * args) Py_RETURN_UOBJECT(level); } +#if WITH_EDITORONLY_DATA PyObject *py_ue_set_current_level(ue_PyUObject *self, PyObject * args) { @@ -321,6 +322,7 @@ PyObject *py_ue_set_current_level(ue_PyUObject *self, PyObject * args) Py_RETURN_FALSE; } +#endif #if WITH_EDITOR PyObject *py_ue_get_level_script_blueprint(ue_PyUObject *self, PyObject * args)