Jump to content

Recommended Posts

  • Active+ Member
On 10/21/2024 at 5:28 AM, 4peppe said:

@ 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
// https://metin2.dev/board/topic/24691-fix-pickup-distances-bug/
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;
		}

 

I have the same "problem" I have to reset the filter after every login, map change or character change then it works. Did you get this fixed? 

On 12/23/2024 at 1:25 PM, Kori said:

I have the same "problem" I have to reset the filter after every login, map change or character change then it works. Did you get this fixed? 

I tested it and did not encounter the problem you mentioned.

  • 2 months later...
  • 5 months later...

I'm getting this error in syserr and I can't solve it, can anyone help me?
 

0816 18:55:06808 :: 
networkModule.py(line:200) SetSelectCharacterPhase
system.py(line:177) __hybrid_import
system.py(line:142) _process_result
introSelect.py(line:28) <module>
system.py(line:177) __hybrid_import
system.py(line:142) _process_result
interfaceModule.py(line:24) <module>
system.py(line:177) __hybrid_import
system.py(line:142) _process_result
uilootingsystem.py(line:466) <module>
uilootingsystem.py(line:1044) LootingSystem

networkModule.SetSelectCharacterPhase - <type 'exceptions.AttributeError'>:'module' object has no attribute '__BL_MOUSE_WHEEL_TOP_WINDOW__'

0816 18:55:06808 :: ============================================================================================================
0816 18:55:06808 :: Abort!!!!

 

i have a small problem here in char_item.cpp take a error at 'owner' in compile game, have TMP4 clean source here screenshot with error and code line

.png
 

#if defined(__BL_OFFICIAL_LOOT_FILTER__)
            if (owner->GetLootFilter() && !owner->GetLootFilter()->CanPickUpItem(item))
            {
                if (owner == this)
                {
                    if (!owner->GetLootFilter()->IsLootFilteredItem(dwVID))
                    {
                        owner->GetLootFilter()->InsertLootFilteredItem(dwVID);

                        if (owner->GetDesc())
                        {
                            TPacketGCLootFilter p;
                            p.header = HEADER_GC_LOOT_FILTER;
                            p.enable = false;
                            p.vid = dwVID;
                            owner->GetDesc()->Packet(&p, sizeof(p));
                        }
                    }

                    ChatPacket(CHAT_TYPE_INFO, "No loot will be collected as the loot filter is deactivated.");
                }
                else
                {
                    ChatPacket(CHAT_TYPE_INFO, "No loot will be collected as a party member's loot filter is deactivated.");
                }

                return false;
            }
#endif
  • Good 1

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.