Aratılır
bool CPythonItem::GetCloseItem(const TPixelPosition & c_rPixelPosition, DWORD * pdwItemID, DWORD dwDistance)
{
...........
}
Kod bloğu altına eklenir.
#ifdef ENABLE_INSTANT_PICKUP_SYSTEM
bool CPythonItem::GetCloseItemVector(const std::string& myName, const TPixelPosition& c_rPixelPosition, std::vector<DWORD>& itemVidList)
{
DWORD dwCloseItemDistance = 1000 * 1000;
TGroundItemInstanceMap::iterator i;
for (i = m_GroundItemInstanceMap.begin(); i != m_GroundItemInstanceMap.end(); ++i)
{
TGroundItemInstance* pInstance = i->second;
DWORD dwxDistance = DWORD(c_rPixelPosition.x - pInstance->v3EndPosition.x);
DWORD dwyDistance = DWORD(c_rPixelPosition.y - (-pInstance->v3EndPosition.y));
DWORD dwDistance = DWORD(dwxDistance * dwxDistance + dwyDistance * dwyDistance);
if (dwDistance < dwCloseItemDistance && (pInstance->stOwnership == "" || pInstance->stOwnership == myName))
{
itemVidList.push_back(i->first);
}
}
return true;
}
#endif