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:
2008-07-14 00:47:07 +00:00
parent 8a19adeb58
commit 38cfe9c1a2
7 changed files with 27 additions and 22 deletions

View File

@@ -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()