Added GameLogic.globalDict, this is a place where data can be stored even when new blend files are loaded. Using for apricot so frankie can go into levels in new blendfiles keeping his inventory, currently it dosnt work for the blenderplayer which stops python before loading new blend files.
This commit is contained in:
@@ -733,6 +733,10 @@ PyObject* initGameLogic(KX_Scene* scene) // quick hack to get gravity hook
|
||||
|
||||
// Add some symbolic constants to the module
|
||||
d = PyModule_GetDict(m);
|
||||
|
||||
// can be overwritten later for gameEngine instances that can load new blend files and re-initialize this module
|
||||
// for now its safe to make sure it exists for other areas such as the web plugin
|
||||
PyDict_SetItemString(d, "globalDict", PyDict_New());
|
||||
|
||||
ErrorObject = PyString_FromString("GameLogic.error");
|
||||
PyDict_SetItemString(d, "error", ErrorObject);
|
||||
|
||||
Reference in New Issue
Block a user