[wpdev-commits] wolfpack/python global.cpp,1.82,1.83
Brought to you by:
rip,
thiagocorrea
|
From: <dar...@us...> - 2003-09-02 02:06:37
|
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv17837/python
Modified Files:
global.cpp
Log Message:
Removed init_sounds
Index: global.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/global.cpp,v
retrieving revision 1.82
retrieving revision 1.83
diff -C2 -d -r1.82 -r1.83
*** global.cpp 2 Sep 2003 01:07:44 -0000 1.82
--- global.cpp 2 Sep 2003 02:06:34 -0000 1.83
***************
*** 59,62 ****
--- 59,63 ----
#include "../targetrequests.h"
#include "../utilsys.h"
+ #include "../basedef.h"
#include "pypacket.h"
***************
*** 1038,1041 ****
--- 1039,1070 ----
}
+ static PyObject* wpCharBase( PyObject* self, PyObject* args )
+ {
+ Q_UNUSED(self);
+ unsigned short id;
+
+ if( !PyArg_ParseTuple( args, "h:wolfpack.charbase( id )", &id ) )
+ return 0;
+
+ cCharBaseDef *def = BaseDefManager::instance()->getCharBaseDef( id );
+
+ if( !def )
+ {
+ Py_XINCREF( Py_None );
+ return Py_None;
+ }
+
+ // Create a Dictionary
+ PyObject *dict = PyDict_New();
+
+ PyDict_SetItemString( dict, "basesound", PyInt_FromLong( def->basesound() ) );
+ PyDict_SetItemString( dict, "soundmode", PyInt_FromLong( def->soundmode() ) );
+ PyDict_SetItemString( dict, "shrinked", PyInt_FromLong( def->shrinked() ) );
+ PyDict_SetItemString( dict, "flags", PyInt_FromLong( def->flags() ) );
+ PyDict_SetItemString( dict, "type", PyInt_FromLong( def->type() ) );
+
+ return dict;
+ }
+
static PyObject* wpPacket( PyObject* self, PyObject* args )
{
***************
*** 1094,1097 ****
--- 1123,1127 ----
{ "isclosing", wpIsClosing, METH_NOARGS, "Returns if the server is in closing state" },
{ "tickcount", wpTickcount, METH_NOARGS, "Returns the current Tickcount on Windows" },
+ { "charbase", wpCharBase, METH_VARARGS, NULL },
{ NULL, NULL, 0, NULL } // Terminator
};
|