Commit 7f6c4cf7 authored by gerstrong@gmail.com's avatar gerstrong@gmail.com

Added another variable support in Python interface. Thinking a more

generalisation for all the foes. We still Action format in python
scripting though.
parent d0038fb1
...@@ -265,6 +265,12 @@ load(GsPythonModule &module, ...@@ -265,6 +265,12 @@ load(GsPythonModule &module,
PyObject* PyObject*
GsPythonFunc::call(PyObject* args) GsPythonFunc::call(PyObject* args)
{ {
if(!mpFunction)
{
gLogging.ftextOut("Python function did not get defined.");
return nullptr;
}
PyObject *pValue = PyObject_CallObject(mpFunction, args); PyObject *pValue = PyObject_CallObject(mpFunction, args);
if (pValue == nullptr) if (pValue == nullptr)
......
...@@ -120,6 +120,10 @@ void CShikadi::processPython() ...@@ -120,6 +120,10 @@ void CShikadi::processPython()
{ {
xDirection = iValue; xDirection = iValue;
} }
if(keyAsStr == "'yinertia'")
{
yinertia = iValue;
}
Py_XDECREF(repr); Py_XDECREF(repr);
Py_XDECREF(str); Py_XDECREF(str);
......
...@@ -36,7 +36,7 @@ bool loadGamefileNames() ...@@ -36,7 +36,7 @@ bool loadGamefileNames()
#if USE_PYTHON3 #if USE_PYTHON3
auto pModule = gPython.loadModule( "keen5", gKeenFiles.gameDir ); auto pModule = gPython.loadModule( "keen5", gKeenFiles.gameDir );
if (pModule != nullptr) if (pModule != nullptr)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment