@ Mali I implemented everything correctly (apparently), it works perfectly on the graphic side, if I activate the premium system with the item and effect it works too, the syerr both client and server side are empty however regardless of how I set the filter it doesn't pick up any items for me (only the yang). The only difference from ur guide and my files is src -> client-> UserInterface -> pythonitem.cpp
// Fix for picking up items
// [Hidden Content]
int DISTANCE_APPROX(int dx, int dy)
{
int min, max;
if (dx < 0)
dx = -dx;
if (dy < 0)
dy = -dy;
if (dx < dy)
{
min = dx;
max = dy;
}
else
{
min = dy;
max = dx;
}
// coefficients equivalent to ( 123/128 * max ) and ( 51/128 * min )
return (((max << 8) + (max << 3) - (max << 4) - (max << 1) +
(min << 7) - (min << 5) + (min << 3) - (min << 1)) >> 8);
}
bool CPythonItem::GetCloseItem(const TPixelPosition& c_rPixelPosition, DWORD* pdwItemID, DWORD dwDistance)
{
DWORD dwCloseItemID = 0;
DWORD dwCloseItemDistance = 0;
int aproMin = 0;
TGroundItemInstanceMap::iterator i;
for (i = m_GroundItemInstanceMap.begin(); i != m_GroundItemInstanceMap.end(); ++i)
{
TGroundItemInstance* pInstance = i->second;
int iDist = DISTANCE_APPROX((int)c_rPixelPosition.x - (int)pInstance->v3EndPosition.x, (int)c_rPixelPosition.y - (-(int)pInstance->v3EndPosition.y));
if (aproMin == 0)
aproMin = iDist;
#if defined(__BL_OFFICIAL_LOOT_FILTER__)
// I applied here the verify for loot_filter
if (aproMin >= iDist && !IsLootFilteredItem(i->first)) {
#else
if (aproMin >= iDist) {
#endif
aproMin = iDist;
dwCloseItemID = i->first;
dwCloseItemDistance = iDist;
}
}
if (dwCloseItemDistance > 300)
return false;
*pdwItemID = dwCloseItemID;
return true;
}