PyObject* dict = PyDict_New();  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 ) ); PyDict_SetItemString( dict, "color", PyInt_FromLong( iter->color ) );  PyList_Append( list, dict );
PyObject* item = PyTuple_New(5); PyTuple_SetItem(item, 0, PyInt_FromLong( iter->itemid ) ); PyTuple_SetItem(item, 1, PyInt_FromLong( xBlockStart + iter->xoff ) ); PyTuple_SetItem(item, 2, PyInt_FromLong( yBlockStart + iter->yoff ) ); PyTuple_SetItem(item, 3, PyInt_FromLong( iter->zoff ) ); PyTuple_SetItem(item, 4, PyInt_FromLong( iter->color ) ); PyTuple_SetItem(tuple, i, item );
static PyObject* wpStatics( PyObject* self, PyObject* args ){	Q_UNUSED( self );	// Minimum is x, y, map	int x = 0,	y = 0,	map = 0;	uchar exact = 0;	if ( !PyArg_ParseTuple( args, "iii|b:wolfpack.statics", &x, &y, &map, &exact ) )		return 0;	if ( !Maps::instance()->hasMap( map ) )	{		PyErr_Format( PyExc_RuntimeError, "Unable to access unknown map %u.", map );	}	int maxX = Maps::instance()->mapTileWidth( map ) * 8;	int maxY = Maps::instance()->mapTileHeight( map ) * 8;	if ( x < 0 )		x = 0;	if ( x >= maxX )		x = maxX - 1;	if ( y < 0 )		y = 0;	if ( y >= maxY )		y = maxY - 1;	StaticsIterator iter = Maps::instance()->staticsIterator( Coord( x, y, 0, map ), exact );	PyObject* list = PyList_New( 0 );	Q_UINT32 xBlock = x / 8;	Q_UINT32 yBlock = y / 8;	for ( ; !iter.atEnd(); ++iter )	{		// Create a Dictionary		PyObject* dict = PyDict_New();		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 ) );		PyDict_SetItemString( dict, "color", PyInt_FromLong( iter->color ) );		PyList_Append( list, dict );	}	return list;}