[wpdev-commits] wolfpack/python char.cpp,1.98,1.99
Brought to you by:
rip,
thiagocorrea
|
From: <dar...@us...> - 2003-08-31 15:24:17
|
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv27065/python
Modified Files:
char.cpp
Log Message:
Added cliloc support to char.message(). Started moving containers to python.
Index: char.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/char.cpp,v
retrieving revision 1.98
retrieving revision 1.99
diff -C2 -d -r1.98 -r1.99
*** char.cpp 11 Aug 2003 12:17:58 -0000 1.98
--- char.cpp 31 Aug 2003 15:23:45 -0000 1.99
***************
*** 142,165 ****
static PyObject* wpChar_message( wpChar* self, PyObject* args )
{
! P_PLAYER player = dynamic_cast<P_PLAYER>(self->pChar);
! if( !self->pChar || self->pChar->free || !player )
return PyFalse;
! if( ( PyTuple_Size( args ) < 1 ) || !PyString_Check( PyTuple_GetItem( args, 0 ) ) )
{
! PyErr_BadArgument();
! return NULL;
}
! QString message = PyString_AsString( PyTuple_GetItem( args, 0 ) );
! if( ( player->bodyID() == 0x3DB ) && message.startsWith( SrvParams->commandPrefix() ) )
! cCommands::instance()->process( player->socket(), message.right( message.length()-1 ) );
! else if( message.startsWith( SrvParams->commandPrefix() ) )
! cCommands::instance()->process( player->socket(), message.right( message.length()-1 ) );
! else if( PyTuple_Size( args ) == 2 && PyInt_Check( PyTuple_GetItem( args, 1 ) ) )
! player->message( message, PyInt_AsLong( PyTuple_GetItem( args, 1 ) ) );
else
! player->message( message );
return PyTrue;
--- 142,186 ----
static PyObject* wpChar_message( wpChar* self, PyObject* args )
{
! P_PLAYER player = dynamic_cast<P_PLAYER>( self->pChar );
!
! if( !player || player->socket() )
return PyFalse;
! if( checkArgStr( 0 ) )
{
! QString message = getArgStr( 0 );
!
! if( ( player->bodyID() == 0x3DB ) && message.startsWith( SrvParams->commandPrefix() ) )
! cCommands::instance()->process( player->socket(), message.right( message.length()-1 ) );
! else if( message.startsWith( SrvParams->commandPrefix() ) )
! cCommands::instance()->process( player->socket(), message.right( message.length()-1 ) );
! else if( PyTuple_Size( args ) == 2 && PyInt_Check( PyTuple_GetItem( args, 1 ) ) )
! player->message( message, PyInt_AsLong( PyTuple_GetItem( args, 1 ) ) );
! else
! player->message( message );
}
+ else if( checkArgInt( 0 ) )
+ {
+ // Affix?
+ QString clilocargs = QString::null;
+ QString affix = QString::null;
! if( checkArgStr( 1 ) )
! clilocargs = getArgStr( 1 );
! if( checkArgStr( 2 ) )
! affix = getArgStr( 2 );
!
! // Cliloc Message
! if( !affix.isNull() )
! player->socket()->clilocMessageAffix( getArgInt( 0 ), clilocargs, affix, 0x37, 3, player, false, false );
! else
! player->socket()->clilocMessage( getArgInt( 0 ), clilocargs, 0x37, 3, player );
! }
else
! {
! PyErr_BadArgument();
! return NULL;
! }
return PyTrue;
***************
*** 1480,1484 ****
return PyFalse;
! if( !lineOfSight( self->pChar->pos(), pos, TREES_BUSHES|DOORS|ROOFING_SLANTED|FLOORS_FLAT_ROOFING|LAVA_WATER ) )
return PyFalse;
--- 1501,1505 ----
return PyFalse;
! if( !lineOfSight( self->pChar->pos(), pos, WALLS_CHIMNEYS|DOORS|FLOORS_FLAT_ROOFING ) )
return PyFalse;
|