diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2012-07-23 02:58:12 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2012-07-23 02:58:12 +0400 |
commit | 7fb85e1fb7a9ceb53b4477402a8536ae07cdc950 (patch) | |
tree | d837ca824a300773ea4a57377152bef2a756ef5c /source/gameengine/Ketsji/KX_PythonInit.cpp | |
parent | df3f3dff3b5c4261b9541998029c248ead5efb2f (diff) |
BGE LibLoad: Allow the user to disable loading text datablocks if they want to attempt to increase security by not loading potential Python scripts.
Diffstat (limited to 'source/gameengine/Ketsji/KX_PythonInit.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_PythonInit.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 823363dfd11..536b32cbd77 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -676,12 +676,12 @@ static PyObject *gLibLoad(PyObject*, PyObject* args, PyObject* kwds) char *err_str= NULL; short options=0; - int load_actions=0, verbose=0; + int load_actions=0, verbose=0, load_scripts=1; - static const char *kwlist[] = {"path", "group", "buffer", "load_actions", "verbose", NULL}; + static const char *kwlist[] = {"path", "group", "buffer", "load_actions", "verbose", "load_scripts", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "ss|y*ii:LibLoad", const_cast<char**>(kwlist), - &path, &group, &py_buffer, &load_actions, &verbose)) + if (!PyArg_ParseTupleAndKeywords(args, kwds, "ss|y*iii:LibLoad", const_cast<char**>(kwlist), + &path, &group, &py_buffer, &load_actions, &verbose, &load_scripts)) return NULL; /* setup options */ @@ -689,6 +689,8 @@ static PyObject *gLibLoad(PyObject*, PyObject* args, PyObject* kwds) options |= KX_BlenderSceneConverter::LIB_LOAD_LOAD_ACTIONS; if (verbose != 0) options |= KX_BlenderSceneConverter::LIB_LOAD_VERBOSE; + if (load_scripts != 0) + options |= KX_BlenderSceneConverter::LIB_LOAD_LOAD_SCRIPTS; if (!py_buffer.buf) { |