PyObject* wpChar_useresource( wpChar* self, PyObject* args )
static PyObject* wpChar_useresource( wpChar* self, PyObject* args )
PyObject* wpChar_useresource( wpChar* self, PyObject* args ){	if( !self->pChar || self->pChar->free )		return PyInt_FromLong( 0 );		if( PyTuple_Size( args ) < 2 || !PyInt_Check( PyTuple_GetItem( args, 0 ) ) || !PyInt_Check( PyTuple_GetItem( args, 1 ) ) )	{		PyErr_BadArgument();		return NULL;	}    UINT16 amount = PyInt_AsLong( PyTuple_GetItem( args, 0 ) );	UINT16 id = PyInt_AsLong( PyTuple_GetItem( args, 1 ) );	UINT16 color = 0;	if( PyTuple_Size( args ) > 2 && PyInt_Check( PyTuple_GetItem( args, 2 ) ) )		color = PyInt_AsLong( PyTuple_GetItem( args, 2 ) );	P_ITEM pPack = self->pChar->getBackpack();	UINT16 deleted = 0;	if( pPack )		deleted = amount - pPack->DeleteAmount( amount, id, color );	return PyInt_FromLong( deleted );}