Jump to content

Item move bug


Go to solution Solved by Verflucht,

Recommended Posts

Does anyone know how to fix the bug where you can't move 2/3 slot items up or down by only 1 or 2 slots? For example, moving a sword 1 slot up. (Note: If it matters, I have the 4 inventory change and, for some reason, only in the first inventory, I can move items 1 slot down just fine, but not up, and not in any other inventory.)

Link to comment
Share on other sites

  • Solution

Go to your binary source > EterPythonLib > PythonGridSlotWindow.cpp

Search this :

DWORD dwSlotNumber = UI::CWindowManager::Instance().GetAttachingSlotNumber();

 

Add under :

		if (dwSlotNumber > 44)
		{
			if (dwSlotNumber < 90)
			{
				dwSlotNumber -= 45;
			}
			else if(dwSlotNumber < 135)
			{
				dwSlotNumber -= 90;
			}
			else if (dwSlotNumber < 180)
			{
				dwSlotNumber -= 135;
			}
		}

 

Search this :

BOOL CGridSlotWindow::GetPickedSlotPointer(TSlot ** ppSlot)

 

And replace the entire function with this :
 

BOOL CGridSlotWindow::GetPickedSlotPointer(TSlot ** ppSlot)
{
	if (!UI::CWindowManager::Instance().IsAttaching())
		return CSlotWindow::GetPickedSlotPointer(ppSlot);

	BYTE byWidth, byHeight;
	UI::CWindowManager::Instance().GetAttachingIconSize(&byWidth, &byHeight);

	std::list<TSlot*> SlotList;
	if (!GetPickedSlotList(byWidth, byHeight, &SlotList))
		return FALSE;

	TSlot * pMinSlot = NULL;
	//DWORD dwSlotNumber = UI::CWindowManager::Instance().GetAttachingSlotNumber();
	//DWORD dwAttachingItemIndex = UI::CWindowManager::Instance().GetAttachingIndex();

	for (std::list<TSlot*>::iterator itor = SlotList.begin(); itor != SlotList.end(); ++itor)
	{
		TSlot * pSlot = *itor;

		if (!pMinSlot)
		{
			pMinSlot = pSlot;
		}
		else
		{
			if (pSlot->dwSlotNumber < pMinSlot->dwSlotNumber && pSlot->dwItemIndex != pMinSlot->dwItemIndex)
			{
				pMinSlot = pSlot;
			}
			else
			{
				if (!pMinSlot->isItem && pSlot->isItem && pSlot->dwItemIndex == pMinSlot->dwItemIndex)
				{
					pMinSlot = pSlot;
				}
			}
		}
	}

	if (!pMinSlot)
	{
		return FALSE;
	}
	else
	{
		TSlot * pCenterSlot;
		if (!GetSlotPointer(pMinSlot->dwCenterSlotNumber, &pCenterSlot))
			return FALSE;

		*ppSlot = pCenterSlot;

		// ?? ???? ?? ?? ???..
		if (UI::CWindowManager::Instance().IsAttaching())
		{
			DWORD dwSlotNumber = UI::CWindowManager::Instance().GetAttachingSlotNumber();
			if (dwSlotNumber > 44)
			{
				if (dwSlotNumber < 90)
				{
					dwSlotNumber -= 45;
				}
				else if (dwSlotNumber < 135)
				{
					dwSlotNumber -= 90;
				}
				else if (dwSlotNumber < 180)
				{
					dwSlotNumber -= 135;
				}
			}
			if (dwSlotNumber == pCenterSlot->dwSlotNumber)
			{
				*ppSlot = pMinSlot;
			}
		}
	}

	return TRUE;
}

 

Hope i helped.

Edited by Erebus
  • Love 2
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 0

      Target Information System

    2. 1

      Feeding game source to LLM

    3. 2

      anti exp explanation pls

    4. 1

      Feeding game source to LLM

    5. 2

      anti exp explanation pls

    6. 0

      [GR2] Positioning an object added with "Attach"

    7. 1417

      [40250] Reference Serverfile + Client + Src [15 Available Languages]

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.