Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv14222/python
Modified Files:
global.cpp
Log Message:
Fixed spawn region
cleared up Python extension to map tiles.
Index: global.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/global.cpp,v
retrieving revision 1.84
retrieving revision 1.85
diff -C2 -d -r1.84 -r1.85
*** global.cpp 2 Sep 2003 02:31:32 -0000 1.84
--- global.cpp 4 Sep 2003 01:22:54 -0000 1.85
***************
*** 500,519 ****
Q_UNUSED(self);
// Minimum is x, y, map
! if( !checkArgInt( 0 ) || !checkArgInt( 1 ) || !checkArgInt( 2 ) )
! {
! PyErr_BadArgument();
return 0;
- }
-
- bool exact = true;
-
- if( checkArgInt( 3 ) && getArgInt( 3 ) == 0 )
- exact = false;
! StaticsIterator iter = Map->staticsIterator( Coord_cl( getArgInt( 0 ), getArgInt( 1 ), 0, getArgInt( 2 ) ), exact );
PyObject *list = PyList_New( 0 );
! UINT32 xBlock = getArgInt( 0 ) / 8;
! UINT32 yBlock = getArgInt( 1 ) / 8;
while( !iter.atEnd() )
--- 500,513 ----
Q_UNUSED(self);
// Minimum is x, y, map
! uint x = 0, y = 0, map = 0;
! uchar exact = 0;
! if ( !PyArg_ParseTuple( args, "iii|b:wolfpack.statics", &x, &y, &map, &exact ) )
return 0;
! StaticsIterator iter = Map->staticsIterator( Coord_cl( x, y, 0, map ), exact );
PyObject *list = PyList_New( 0 );
! UINT32 xBlock = x / 8;
! UINT32 yBlock = y / 8;
while( !iter.atEnd() )
***************
*** 524,528 ****
PyDict_SetItemString( dict, "id", PyInt_FromLong( iter->itemid ) );
PyDict_SetItemString( dict, "x", PyInt_FromLong( ( xBlock * 8 ) + iter->xoff ) );
! PyDict_SetItemString( dict, "y", PyInt_FromLong( ( yBlock * 8 )+ iter->yoff ) );
PyDict_SetItemString( dict, "z", PyInt_FromLong( iter->zoff ) );
--- 518,522 ----
PyDict_SetItemString( dict, "id", PyInt_FromLong( iter->itemid ) );
PyDict_SetItemString( dict, "x", PyInt_FromLong( ( xBlock * 8 ) + iter->xoff ) );
! PyDict_SetItemString( dict, "y", PyInt_FromLong( ( yBlock * 8 ) + iter->yoff ) );
PyDict_SetItemString( dict, "z", PyInt_FromLong( iter->zoff ) );
|