version 1.20 | | version 1.21 |
---|
| | |
static int do_script(CFPContext* context,int silent) | | static int do_script(CFPContext* context,int silent) |
{ | | { |
FILE* scriptfile; | | FILE* scriptfile; |
PyObject* built; | | |
PyObject* dict; | | PyObject* dict; |
PyObject* ret; | | PyObject* ret; |
#if 0 | | #if 0 |
| | |
} | | } |
pushContext(context); | | pushContext(context); |
dict = PyDict_New(); | | dict = PyDict_New(); |
built = PyEval_GetBuiltins(); | | PyDict_SetItemString(dict, "__builtins__", PyEval_GetBuiltins()); |
PyDict_SetItemString(dict, "__builtins__", built); | | |
Py_XDECREF(built); | | |
ret = PyRun_File(scriptfile, context->script, Py_file_input, dict, dict); | | ret = PyRun_File(scriptfile, context->script, Py_file_input, dict, dict); |
if (PyErr_Occurred()) | | if (PyErr_Occurred()) |
{ | | { |
| | |
context->message[0]=0; | | context->message[0]=0; |
| | |
context->who = Crossfire_Object_wrap(op); | | context->who = Crossfire_Object_wrap(op); |
| | context->activator = NULL; |
| | context->third = NULL; |
context->fix = 0; | | context->fix = 0; |
snprintf(context->script, sizeof(context->script), "%s", buf); | | snprintf(context->script, sizeof(context->script), "%s", buf); |
snprintf(context->options, sizeof(context->options), "%s", params); | | snprintf(context->options, sizeof(context->options), "%s", params); |