Jump to content

Recommended Posts

  • Active+ Member

Hey guys,

can someone explain me how this function work? I mean I don't know what is this line: 

m_pkGrid = M2_NEW CGrid(5, m_iSize);

And what it exactly doing. I think m_iSize somehow working with number 135. Because If i extend number 5 to 10 I will got 540 slots of safebox working right. But If I extend this number to for example 15 the slots will be bugged and item will disappear if I move item to safebox on slot number > 540.

CSafebox::CSafebox(LPCHARACTER pkChrOwner, int iSize, DWORD dwGold) : m_pkChrOwner(pkChrOwner), m_iSize(iSize), m_lGold(dwGold)
{
	assert(m_pkChrOwner != NULL);
	memset(m_pkItems, 0, sizeof(m_pkItems));

	if (m_iSize)
		m_pkGrid = M2_NEW CGrid(5, m_iSize);
	else
		m_pkGrid = NULL;

	m_bWindowMode = SAFEBOX;
}

Thanks for answers!

Sincerely,

ReFresh

I'll be always helpful!  😉

Link to comment
https://metin2.dev/topic/20592-need-an-explaination-for-a-function/
Share on other sites

  • Premium
#define SAFEBOX_MAX_NUM			135
#define SAFEBOX_PASSWORD_MAX_LEN	6

	public:
		enum
		{
			SAFEBOX_SLOT_X_COUNT = 5,
			SAFEBOX_SLOT_Y_COUNT = 9,
			SAFEBOX_PAGE_SIZE = SAFEBOX_SLOT_X_COUNT * SAFEBOX_SLOT_Y_COUNT,
		};
		typedef std::vector<TItemData> TItemInstanceVector;

 

2 minutes ago, ReFresh said:

@T4UMP Can you stop spamming your offensive answers with no solution?

Haha no, you are autistic, you need only verbal abuse and offensive words, go fast copying ekura ahhah.


 

  • Active+ Member

@T4UMP I did it :) SAFEBOX_MAX_NUM 135 changed to 600

This changed to: 10x10

SAFEBOX_SLOT_X_COUNT = 10,
SAFEBOX_SLOT_Y_COUNT = 10,

I like kids like you are :) I'm just having fun with your braindead answers :)

I'll be always helpful!  😉

  • Premium
bool CPythonNetworkStream::SendSafeBoxItemMovePacket(UINT bySourcePos, UINT byTargetPos, uint8_t byCount)
{
    __PlaySafeBoxItemDropSound(bySourcePos);

    TPacketCGItemMove kItemMove;
    kItemMove.header = HEADER_CG_SAFEBOX_ITEM_MOVE;
    kItemMove.pos = TItemPos(INVENTORY, bySourcePos);
    kItemMove.num = byCount;
    kItemMove.change_pos = TItemPos(INVENTORY, byTargetPos);
    if (!Send(sizeof(kItemMove), &kItemMove))
        return false;

    return SendSequence();
}

 

 

  • Love 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.