[wpdev-commits] wolfpack/python char.cpp,1.110,1.111
Brought to you by:
rip,
thiagocorrea
|
From: <co...@us...> - 2003-11-25 19:41:33
|
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv5611/python
Modified Files:
char.cpp
Log Message:
secure trading code support for python
Index: char.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/char.cpp,v
retrieving revision 1.110
retrieving revision 1.111
diff -C2 -d -r1.110 -r1.111
*** char.cpp 30 Sep 2003 15:06:30 -0000 1.110
--- char.cpp 25 Nov 2003 19:41:30 -0000 1.111
***************
*** 1619,1622 ****
--- 1619,1653 ----
}
+ static PyObject* wpChar_additem( wpChar *self, PyObject *args )
+ {
+ if( self->pChar->free )
+ return PyFalse;
+
+ if( !checkArgInt( 0 ) && !checkArgItem( 1 ) )
+ {
+ PyErr_BadArgument();
+ return 0;
+ }
+ bool handleWeight = true;
+ bool noRemove = false;
+
+ if( PyTuple_Size( args ) > 2 && checkArgInt( 2 ) )
+ handleWeight = getArgInt( 2 ) > 0?true:false;
+
+ if( PyTuple_Size( args ) > 2 && checkArgInt( 3 ) )
+ noRemove = getArgInt( 3 ) > 0?true:false;
+
+ int layer = getArgInt( 0 );
+ P_ITEM pItem = getArgItem( 1 );
+
+ if( !pItem )
+ return PyFalse;
+
+ self->pChar->addItem( (cBaseChar::enLayer)layer, pItem, handleWeight, noRemove );
+
+ return PyTrue;
+ }
+
+
static PyMethodDef wpCharMethods[] =
{
***************
*** 1650,1653 ****
--- 1681,1685 ----
{ "cansee", (getattrofunc)wpChar_cansee, METH_VARARGS, NULL },
{ "lightning", (getattrofunc)wpChar_lightning, METH_VARARGS, NULL },
+ { "additem", (getattrofunc)wpChar_additem, METH_VARARGS, "Creating item on specified layer."},
// Mostly NPC functions
|