[wpdev-commits] wolfpack/python char.cpp,1.104,1.105 socket.cpp,1.42,1.43
Brought to you by:
rip,
thiagocorrea
|
From: <dar...@us...> - 2003-09-15 12:49:09
|
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv18229/python
Modified Files:
char.cpp socket.cpp
Log Message:
Removed DyeTubs and Bandages from Source and added some missing methods to PySocket and PyChar.
Index: char.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/char.cpp,v
retrieving revision 1.104
retrieving revision 1.105
diff -C2 -d -r1.104 -r1.105
*** char.cpp 13 Sep 2003 13:08:41 -0000 1.104
--- char.cpp 15 Sep 2003 12:49:05 -0000 1.105
***************
*** 1472,1478 ****
{
Q_UNUSED(args);
! if( !self->pChar || self->pChar->free || ( !checkArgObject( 0 ) && !checkArgCoord( 0 ) ) || !checkArgInt( 1 ) )
return PyFalse;
Coord_cl pos;
--- 1472,1483 ----
{
Q_UNUSED(args);
! if( self->pChar->free || ( !checkArgObject( 0 ) && !checkArgCoord( 0 ) ) || !checkArgInt( 1 ) )
return PyFalse;
+ P_PLAYER pPlayer = dynamic_cast< P_PLAYER >( self->pChar );
+
+ if( pPlayer && pPlayer->isGM() )
+ return PyTrue;
+
Coord_cl pos;
***************
*** 1488,1492 ****
if( !obj )
! obj = getArgItem( 0 );
if( !obj )
--- 1493,1504 ----
if( !obj )
! {
! P_ITEM pItem = getArgItem( 0 );
!
! if( pItem && pItem->getOutmostChar() == self->pChar )
! return PyTrue;
!
! obj = pItem;
! }
if( !obj )
***************
*** 1510,1513 ****
--- 1522,1546 ----
}
+ static PyObject* wpChar_canpickup( wpChar* self, PyObject* args )
+ {
+ if( self->pChar->free )
+ return PyFalse;
+
+ if( PyTuple_Size( args ) != 1 )
+ {
+ PyErr_BadArgument();
+ return 0;
+ }
+
+ P_ITEM pItem = getArgItem( 0 );
+
+ P_PLAYER pPlayer = dynamic_cast< P_PLAYER >( self->pChar );
+
+ if( !pPlayer )
+ return PyFalse;
+
+ return pPlayer->canPickUp( pItem ) ? PyTrue : PyFalse;
+ }
+
static PyMethodDef wpCharMethods[] =
{
***************
*** 1538,1541 ****
--- 1571,1575 ----
{ "disturb", (getattrofunc)wpChar_disturb, METH_VARARGS, "Disturbs whatever this character is doing right now." },
{ "canreach", (getattrofunc)wpChar_canreach, METH_VARARGS, "Checks if this character can reach a certain object." },
+ { "canpickup", (getattrofunc)wpChar_canpickup, METH_VARARGS, NULL },
// Mostly NPC functions
Index: socket.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/socket.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** socket.cpp 28 Aug 2003 20:56:17 -0000 1.42
--- socket.cpp 15 Sep 2003 12:49:05 -0000 1.43
***************
*** 635,638 ****
--- 635,650 ----
}
+ static PyObject *wpSocket_log( wpSocket *self, PyObject *args )
+ {
+ char loglevel;
+ char *text;
+
+ if( !PyArg_ParseTuple( args, "bs:socket.log( loglevel, text )", &loglevel, &text ) )
+ return 0;
+
+ self->pSock->log( (eLogLevel)loglevel, text );
+ return PyTrue;
+ }
+
static PyMethodDef wpSocketMethods[] =
{
***************
*** 657,660 ****
--- 669,673 ----
{ "resendstatus", (getattrofunc)wpSocket_resendstatus, METH_VARARGS, "Resends the status windows to this client." },
{ "customize", (getattrofunc)wpSocket_customize, METH_VARARGS, "Begin house customization." },
+ { "log", (getattrofunc)wpSocket_log, METH_VARARGS, NULL },
{ NULL, NULL, 0, NULL }
};
|