PyObject* wpChar_distanceto( wpChar* self, PyObject* args )
static PyObject* wpChar_distanceto( wpChar* self, PyObject* args )
PyObject* wpChar_distanceto( wpChar* self, PyObject* args ){	if( !self->pChar || self->pChar->free )		return PyInt_FromLong( -1 );	// Probably an object	if( PyTuple_Size( args ) == 1 )	{		PyObject *pObj = PyTuple_GetItem( args, 0 );		if( checkWpCoord( PyTuple_GetItem( args, 0 ) ) )			return PyInt_FromLong( self->pChar->pos().distance( getWpCoord( pObj ) ) );		// Item		P_ITEM pItem = getWpItem( pObj );		if( pItem )			return PyInt_FromLong( pItem->dist( self->pChar ) );		P_CHAR pChar = getWpChar( pObj );        if( pChar )			return PyInt_FromLong( pChar->dist( self->pChar ) );	}	else if( PyTuple_Size( args ) >= 2 ) // Min 2 	{		Coord_cl pos = self->pChar->pos();		if( !PyInt_Check( PyTuple_GetItem( args, 0 ) ) || !PyInt_Check( PyTuple_GetItem( args, 1 ) ) )			return PyInt_FromLong( -1 );		pos.x = PyInt_AsLong( PyTuple_GetItem( args, 0 ) );		pos.y = PyInt_AsLong( PyTuple_GetItem( args, 1 ) );  		return PyInt_FromLong( self->pChar->pos().distance( pos ) );	}	PyErr_BadArgument();	return NULL;}