mirror of
https://github.com/worldforge/cyphesis
synced 2026-08-13 12:26:04 -04:00
2002-05-17 Al Riddoch <alriddoch@zepler.org>
* rulesets/Py_Operation.cpp, rulesets/Py_Operation.h: Add a variant of the python Operation wrapper which handles const operations. * rulesets/PythonMindScript.cpp, rulesets/PythonThingScript.cpp: Pass const versions of operations to the python scripts, rather than having to copy them. * server/ServerRouting.cpp: Add build date, time and version to server info.
This commit is contained in:
parent
8ef5400ad4
commit
13922d54da
8 changed files with 133 additions and 18 deletions
|
|
@ -42,15 +42,14 @@ bool PythonThingScript::Operation(const std::string & op_type,
|
|||
<< "." << op_name << std::endl << std::flush;);
|
||||
return false;
|
||||
}
|
||||
OperationObject * py_op = newAtlasRootOperation(NULL);
|
||||
py_op->operation = new RootOperation(op);
|
||||
ConstOperationObject * py_op = newAtlasConstRootOperation(NULL);
|
||||
py_op->operation = &op;
|
||||
py_op->own = 0;
|
||||
py_op->from = thing.world->getObject(op.GetFrom());
|
||||
py_op->to = thing.world->getObject(op.GetTo());
|
||||
PyObject * ret;
|
||||
ret = PyObject_CallMethod(scriptObject, (char *)(op_name.c_str()),
|
||||
"(O)", py_op);
|
||||
delete py_op->operation;
|
||||
Py_DECREF(py_op);
|
||||
if (ret != NULL) {
|
||||
debug( std::cout << "Called python method " << op_name
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue