xUniverse 18 Posted November 12, 2018 Share Posted November 12, 2018 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? Link to comment Share on other sites More sharing options...
_Sielu 13 Posted November 12, 2018 Share Posted November 12, 2018 crash is in bool CPythonPlayer::__HasEnoughArrow() just use pItemData in case if (CItemManager::Instance().GetItemDataPointer(GetItemIndex(TItemPos(INVENTORY, c_Equipment_Arrow)), &pItemData)) Link to comment Share on other sites More sharing options...
xUniverse 18 Posted November 12, 2018 Author Share Posted November 12, 2018 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; } Link to comment Share on other sites More sharing options...
notbugme 14 Posted November 14, 2018 Share Posted November 14, 2018 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now