Difference for plugins/cfpython/cfpython.c from version 1.10 to 1.11


version 1.10 version 1.11
Line 599
 
Line 599
   
     Py_Initialize();      Py_Initialize();
     Crossfire_ObjectType.tp_new = PyType_GenericNew;      Crossfire_ObjectType.tp_new = PyType_GenericNew;
       Crossfire_MapType.tp_new    = PyType_GenericNew;
       Crossfire_PlayerType.tp_new = PyType_GenericNew;
     PyType_Ready(&Crossfire_ObjectType);      PyType_Ready(&Crossfire_ObjectType);
     PyType_Ready(&Crossfire_MapType);      PyType_Ready(&Crossfire_MapType);
     PyType_Ready(&Crossfire_PlayerType);      PyType_Ready(&Crossfire_PlayerType);
Line 606
 
Line 608
     m = Py_InitModule("Crossfire", CFPythonMethods);      m = Py_InitModule("Crossfire", CFPythonMethods);
     d = PyModule_GetDict(m);      d = PyModule_GetDict(m);
     Py_INCREF(&Crossfire_ObjectType);      Py_INCREF(&Crossfire_ObjectType);
       Py_INCREF(&Crossfire_MapType);
       Py_INCREF(&Crossfire_PlayerType);
   
     PyModule_AddObject(m, "Object", (PyObject*)&Crossfire_ObjectType);      PyModule_AddObject(m, "Object", (PyObject*)&Crossfire_ObjectType);
       PyModule_AddObject(m, "Map", (PyObject*)&Crossfire_MapType);
       PyModule_AddObject(m, "Player", (PyObject*)&Crossfire_PlayerType);
   
     CFPythonError = PyErr_NewException("Crossfire.error",NULL,NULL);      CFPythonError = PyErr_NewException("Crossfire.error",NULL,NULL);
     PyDict_SetItemString(d,"error",CFPythonError);      PyDict_SetItemString(d,"error",CFPythonError);
     for (i=0;i<NR_CUSTOM_CMD;i++)      for (i=0;i<NR_CUSTOM_CMD;i++)
Line 702
 
Line 710
     fclose(scriptfile);      fclose(scriptfile);
     context = popContext();      context = popContext();
     rv = context->returnvalue;      rv = context->returnvalue;
     /*Py_XDECREF(context->who);      Py_XDECREF(context->who);
     Py_XDECREF(context->activator);      Py_XDECREF(context->activator);
     Py_XDECREF(context->third);*/      Py_XDECREF(context->third);
     free(context);      free(context);
     printf("Execution complete");      printf("Execution complete");
     return rv;      return rv;
Line 889
 
Line 897
     fclose(scriptfile);      fclose(scriptfile);
     context = popContext();      context = popContext();
     rv = context->returnvalue;      rv = context->returnvalue;
     /*Py_XDECREF(context->who);      Py_XDECREF(context->who);
     Py_XDECREF(context->activator);      Py_XDECREF(context->activator);
     Py_XDECREF(context->third);*/      Py_XDECREF(context->third);
     free(context);      free(context);
   
     return &rv;      return &rv;
Line 939
 
Line 947
     fclose(scriptfile);      fclose(scriptfile);
     context = popContext();      context = popContext();
     rv = context->returnvalue;      rv = context->returnvalue;
     /*Py_XDECREF(context->who);      Py_XDECREF(context->who);
     Py_XDECREF(context->activator);      Py_XDECREF(context->activator);
     Py_XDECREF(context->third);*/      Py_XDECREF(context->third);
     free(context);      free(context);
     return &rv;      return &rv;
 }  }
Line 949
 
Line 957
 CF_PLUGIN int   closePlugin()  CF_PLUGIN int   closePlugin()
 {  {
     printf("CFPython 2.0a closing\n");      printf("CFPython 2.0a closing\n");
       Py_Finalize();
     return 0;      return 0;
 }  }
   


Legend:
line(s) removed in v.1.10 
line(s) changed
 line(s) added in v.1.11

File made using version 1.98 of cvs2html by leaf at 2011-07-21 16:59