importing the GameLogic module was being done by adding the text "import GameLogic" to the start of all scripts used in the game engine, this meant every error line number was off by 1 (quite annoying). better to do this to the dictionary that the scripts run with.
This commit is contained in:
@@ -828,20 +828,9 @@ PyObject* initGameLogic(KX_Scene* scene) // quick hack to get gravity hook
|
||||
Py_FatalError("can't initialize module GameLogic");
|
||||
}
|
||||
|
||||
return d;
|
||||
return m;
|
||||
}
|
||||
|
||||
void dictionaryClearByHand(PyObject *dict)
|
||||
{
|
||||
// Clears the dictionary by hand:
|
||||
// This prevents, extra references to global variables
|
||||
// inside the GameLogic dictionary when the python interpreter is finalized.
|
||||
// which allows the scene to safely delete them :)
|
||||
// see: (space.c)->start_game
|
||||
if(dict) PyDict_Clear(dict);
|
||||
}
|
||||
|
||||
|
||||
// Python Sandbox code
|
||||
// override builtin functions import() and open()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user