I've redone the function and works fine for me!
PyObject* playerCheckAffect(PyObject* poSelf, PyObject* poArgs)
{
int dwType;
BYTE bApplyOn;
switch (PyTuple_Size(poArgs))
{
case 2:
if (!PyTuple_GetInteger(poArgs, 0, &dwType))
return Py_BadArgument();
if (!PyTuple_GetByte(poArgs, 1, &bApplyOn))
return Py_BadArgument();
break;
default:
return Py_BuildException();
}
int iAffIndex = CPythonPlayer::Instance().GetAffectDataIndex(dwType, bApplyOn);
return Py_BuildValue("b", iAffIndex != -1);
}
Hope it helps