Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9671/python
Modified Files:
char.cpp
Log Message:
Reimplemented context menus
Index: char.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/char.cpp,v
retrieving revision 1.116
retrieving revision 1.117
diff -C2 -d -r1.116 -r1.117
*** char.cpp 28 Jan 2004 02:12:20 -0000 1.116
--- char.cpp 28 Jan 2004 02:18:14 -0000 1.117
***************
*** 4,8 ****
// UO Server Emulation Program
//
! // Copyright 2001-2003 by holders identified in authors.txt
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
--- 4,8 ----
// UO Server Emulation Program
//
! // Copyright 2001-2004 by holders identified in authors.txt
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
***************
*** 558,572 ****
if( !checkArgStr( 0 ) )
{
! PyErr_BadArgument();
! return 0;
! }
! INT16 color = -1;
! if( checkArgInt( 1 ) )
! color = getArgInt( 1 );
! self->pChar->talk( getArgStr( 0 ), color );
! return PyTrue;
}
--- 558,592 ----
if( !checkArgStr( 0 ) )
{
! P_NPC npc = dynamic_cast<P_NPC>( self->pChar);
! if ( !npc )
! return PyFalse;
!
! if( !checkArgInt( 0 ) )
! {
! PyErr_BadArgument();
! return 0;
! }
!
! ushort color = -1;
! uint cliloc = getArgInt( 0 );
! if( checkArgInt( 1 ) )
! color = getArgInt( 1 );
!
! npc->talk( cliloc, 0, color );
! return PyTrue;
! }
! else
! {
! INT16 color = -1;
!
! if( checkArgInt( 1 ) )
! color = getArgInt( 1 );
! self->pChar->talk( getArgStr( 0 ), color );
! return PyTrue;
! }
! return PyFalse;
}
***************
*** 1339,1342 ****
--- 1359,1374 ----
/*!
+ Are we dead.
+ */
+ static PyObject* wpChar_isdead( wpChar* self, PyObject* args )
+ {
+ Q_UNUSED(args);
+ if( !self->pChar || self->pChar->free )
+ return PyTrue;
+
+ return self->pChar->isDead() ? PyTrue : PyFalse;
+ }
+
+ /*!
Let's this character attack someone else.
*/
***************
*** 1686,1689 ****
--- 1718,1722 ----
{ "lightning", (getattrofunc)wpChar_lightning, METH_VARARGS, NULL },
{ "additem", (getattrofunc)wpChar_additem, METH_VARARGS, "Creating item on specified layer."},
+ { "isdead", (getattrofunc)wpChar_isdead, METH_VARARGS, "Checks if the character is alive or not."},
// Mostly NPC functions
|