Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv24095/python
Modified Files:
global.cpp
Log Message:
Clean up
Index: global.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/global.cpp,v
retrieving revision 1.85
retrieving revision 1.86
diff -C2 -d -r1.85 -r1.86
*** global.cpp 4 Sep 2003 01:22:54 -0000 1.85
--- global.cpp 5 Sep 2003 20:12:38 -0000 1.86
***************
*** 381,391 ****
{
Q_UNUSED(self);
- if( PyTuple_Size( args ) < 1 || !PyInt_Check( PyTuple_GetItem( args, 0 ) ) )
- {
- PyErr_BadArgument();
- return NULL;
- }
! SERIAL serial = PyInt_AsLong( PyTuple_GetItem( args, 0 ) );
return PyGetItemObject( FindItemBySerial( serial ) );
}
--- 381,389 ----
{
Q_UNUSED(self);
! SERIAL serial = INVALID_SERIAL;
! if ( !PyArg_ParseTuple( args, "i:wolfpack.finditem", &serial ) )
! return 0;
!
return PyGetItemObject( FindItemBySerial( serial ) );
}
***************
*** 398,413 ****
{
Q_UNUSED(self);
! if( PyTuple_Size( args ) < 1 || !PyInt_Check( PyTuple_GetItem( args, 0 ) ) )
! {
! PyErr_BadArgument();
! return NULL;
! }
- SERIAL serial = PyInt_AsLong( PyTuple_GetItem( args, 0 ) );
return PyGetCharObject( FindCharBySerial( serial ) );
}
! /*
! * Creates a multi object based on the passed pos
*/
static PyObject* wpFindmulti( PyObject* self, PyObject* args )
--- 396,408 ----
{
Q_UNUSED(self);
! SERIAL serial = INVALID_SERIAL;
! if ( !PyArg_ParseTuple( args, "i:wolfpack.finditem", &serial ) )
! return 0;
return PyGetCharObject( FindCharBySerial( serial ) );
}
! /*!
! Creates a multi object based on the passed pos
*/
static PyObject* wpFindmulti( PyObject* self, PyObject* args )
***************
*** 432,436 ****
return PyGetMultiObject( pMulti );
-
}
--- 427,430 ----
***************
*** 473,483 ****
Q_UNUSED(self);
// Three arguments
! if( !checkArgInt( 0 ) || !checkArgInt( 1 ) || !checkArgInt( 2 ) )
! {
! PyErr_BadArgument();
return 0;
- }
! return PyGetRegionObject( AllTerritories::instance()->region( getArgInt( 0 ), getArgInt( 1 ), getArgInt(2) ) );
}
--- 467,475 ----
Q_UNUSED(self);
// Three arguments
! int x = 0, y = 0, map = 0;
! if ( !PyArg_ParseTuple( args, "iii:wolfpack.region", &x, &y, &map ) )
return 0;
! return PyGetRegionObject( AllTerritories::instance()->region( x, y, map ) );
}
***************
*** 587,602 ****
Q_UNUSED(self);
// Minimum is x, y, map
! if( !checkArgInt( 0 ) || !checkArgInt( 1 ) || !checkArgInt( 2 ) )
! {
! PyErr_BadArgument();
return 0;
- }
! UINT32 range = 1;
!
! if( checkArgInt( 3 ) && getArgInt( 3 ) > 1 )
! range = getArgInt( 3 );
!
! Coord_cl pos( getArgInt( 0 ), getArgInt( 1 ), 0, getArgInt( 2 ) );
RegionIterator4Items iter( pos, range );
--- 579,587 ----
Q_UNUSED(self);
// Minimum is x, y, map
! uint x = 0, y = 0, map = 0, range = 1;
! if ( !PyArg_ParseTuple( args, "iii|i:wolfpack.items", &x, &y, &map, &range ) )
return 0;
! Coord_cl pos( x, y, 0, map );
RegionIterator4Items iter( pos, range );
***************
*** 620,635 ****
Q_UNUSED(self);
// Minimum is x, y, map
! if( !checkArgInt( 0 ) || !checkArgInt( 1 ) || !checkArgInt( 2 ) )
! {
! PyErr_BadArgument();
return 0;
- }
! UINT32 range = 1;
!
! if( checkArgInt( 3 ) && getArgInt( 3 ) > 1 )
! range = getArgInt( 3 );
!
! Coord_cl pos( getArgInt( 0 ), getArgInt( 1 ), 0, getArgInt( 2 ) );
RegionIterator4Chars iter( pos, range );
--- 605,613 ----
Q_UNUSED(self);
// Minimum is x, y, map
! uint x = 0, y = 0, map = 0, range = 1;
! if ( !PyArg_ParseTuple( args, "iii|i:wolfpack.chars", &x, &y, &map, &range ) )
return 0;
! Coord_cl pos( x, y, 0, map );
RegionIterator4Chars iter( pos, range );
|