Jump to content

Item switching/changing problem.


Go to solution Solved by tonyp2812,

Recommended Posts

Hello everyone!

I've encoutered an unusual problem. I've just started working on my own little server and I'm pretty new to this. I've sucessfully added 4 eq pages - it's working well (for the most part). What I mean is - i can store and move items across all of the 4 pages. I have also added some new armors. They're all wearable, no problems there. Textrures and all are fine. The problem is that i can't change switch the armor that I'm wearing from any other page than the first one. It happens for all armors, even preexisting ones for lower levels. For example - I'm wearing an armor for 130 lv and want it to change to an armor for 180 lv. I can do it but only from the first page. It's crazy. Any ideas to what might be the cause? I also have to add that I can put on the armor from other pages but only when I'm not wearing one already. I thought it might have sth to do with the items I've added but problem remains for all items.

I'll be thankfull for any help.

I hope I've explained my problem clearly.  

Link to comment
https://metin2.dev/topic/32160-item-switchingchanging-problem/
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Just now, lime said:

Does it have the same behaviour when you have an item on the second inventory page?

Yes - it suprised me, as I thought it would only affect the new 3rd and 4th pages. 2nd page doesn't work too.

  • Solution

Problem solved. I'll explain the issue, maybe someone will need it one day.

I've followed this tut: 

But in it's newest version. I've followed the downloaded txt file. The problem lies in exchange.cpp:

 

#define INVEN_PAGES	4
#define INVEN_PAGE_SIZE	(INVENTORY_MAX_NUM / INVEN_PAGES)

 

bool CExchange::CheckSpace()
Replace:

	for (i = 0; i < INVEN_PAGE_SIZE; ++i)
	{
		if (!(item = victim->GetInventoryItem(i)))
			continue;

		s_grid1.Put(i, 1, item->GetSize());
	}
	for (i = INVEN_PAGE_SIZE; i < INVEN_PAGE_SIZE*2; ++i)
	{
		if (!(item = victim->GetInventoryItem(i)))
			continue;

		s_grid2.Put(i - INVEN_PAGE_SIZE, 1, item->GetSize());
	}
	for (i = INVEN_PAGE_SIZE*2; i < INVEN_PAGE_SIZE*3; ++i)
	{
		if (!(item = victim->GetInventoryItem(i)))
			continue;

		s_grid3.Put(i - INVEN_PAGE_SIZE*2, 1, item->GetSize());
	}
	for (i = INVEN_PAGE_SIZE*3; i < INVENTORY_MAX_NUM; ++i)
	{
		if (!(item = victim->GetInventoryItem(i)))
			continue;

		s_grid4.Put(i - INVEN_PAGE_SIZE*3, 1, item->GetSize());
	}

 

 

For some reason the "define" part caused the issue. I tried using this versoin, without the "define part":

for (i = 0; i < INVENTORY_MAX_NUM / 4; ++i)
	{
		if (!(item = victim->GetInventoryItem(i)))
			continue;

		s_grid1.Put(i, 1, item->GetSize());
	}
	for (i = INVENTORY_MAX_NUM / 4; i < INVENTORY_MAX_NUM; ++i)
	{
		if (!(item = victim->GetInventoryItem(i)))
			continue;

		s_grid2.Put(i - INVENTORY_MAX_NUM / 4, 1, item->GetSize());
	}

	for (i = INVENTORY_MAX_NUM / 4; i < INVENTORY_MAX_NUM; ++i)
	{
		if (!(item = victim->GetInventoryItem(i)))
			continue;

		s_grid3.Put(i - INVENTORY_MAX_NUM / 4, 1, item->GetSize());
	}
	for (i = INVENTORY_MAX_NUM / 4; i < INVENTORY_MAX_NUM; ++i)
	{
		if (!(item = victim->GetInventoryItem(i)))
			continue;

		s_grid4.Put(i - INVENTORY_MAX_NUM / 4, 1, item->GetSize());
	}

 

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.