Jump to content

Recommended Posts

Hi,

I have a problem with my client, it crash when I click the left button to try to attack without enough arrows (it doesn't happen if I attack with the space bar)

I checked the syserr of client and game, but nothing.

I compiled my binary in debug mode to see what is wrong, but nothing again.

Any idea?

 

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

crash is in bool CPythonPlayer::__HasEnoughArrow()

just use pItemData in case if (CItemManager::Instance().GetItemDataPointer(GetItemIndex(TItemPos(INVENTORY, c_Equipment_Arrow)), &pItemData))

 

hace 13 horas, _Sielu dijo:

crash is in bool CPythonPlayer::__HasEnoughArrow()

just use pItemData in case if (CItemManager::Instance().GetItemDataPointer(GetItemIndex(TItemPos(INVENTORY, c_Equipment_Arrow)), &pItemData))

 

Thanks, 

This part of my function was good, but I found the problem in: if (CItemData::WEAPON_ARROW == pItemData->GetSubType()). 

Solved. 

### If someone has the same problem (and has NEW_ARROW_SYSTEM enabled), this is my fixed __HasEnoughArrow() function (in PythonPlayerSkill.cpp?

bool CPythonPlayer::__HasEnoughArrow()
{
	CItemData * pItemData;
	if (CItemManager::Instance().GetItemDataPointer(GetItemIndex(TItemPos(INVENTORY, c_Equipment_Arrow)), &pItemData))
	if (CItemData::ITEM_TYPE_WEAPON == pItemData->GetType())
#ifdef ENABLE_NEW_ARROW_SYSTEM
	if (CItemData::WEAPON_ARROW == pItemData->GetSubType() || CItemData::WEAPON_UNLIMITED_ARROW == pItemData->GetSubType())
#else
	if (CItemData::WEAPON_ARROW == pItemData->GetSubType())
#endif
	{
		return true;
	}

	PyCallClassMemberFunc(m_ppyGameWindow, "OnCannotShotError", Py_BuildValue("(is)", GetMainCharacterIndex(), "EMPTY_ARROW"));
	return false;
}

 

Dnia 12.11.2018 o 17:20, xUniverse napisał:

Thanks, 

This part of my function was good, but I found the problem in: if (CItemData::WEAPON_ARROW == pItemData->GetSubType()). 

Solved. 

### If someone has the same problem (and has NEW_ARROW_SYSTEM enabled), this is my fixed __HasEnoughArrow() function (in PythonPlayerSkill.cpp?


bool CPythonPlayer::__HasEnoughArrow()
{
	CItemData * pItemData;
	if (CItemManager::Instance().GetItemDataPointer(GetItemIndex(TItemPos(INVENTORY, c_Equipment_Arrow)), &pItemData))
	if (CItemData::ITEM_TYPE_WEAPON == pItemData->GetType())
#ifdef ENABLE_NEW_ARROW_SYSTEM
	if (CItemData::WEAPON_ARROW == pItemData->GetSubType() || CItemData::WEAPON_UNLIMITED_ARROW == pItemData->GetSubType())
#else
	if (CItemData::WEAPON_ARROW == pItemData->GetSubType())
#endif
	{
		return true;
	}

	PyCallClassMemberFunc(m_ppyGameWindow, "OnCannotShotError", Py_BuildValue("(is)", GetMainCharacterIndex(), "EMPTY_ARROW"));
	return false;
}

 

Thank you bro.

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.