NvL 1 Posted July 28, 2022 Share Posted July 28, 2022 (edited) crash core when I put items on the mob Edited July 28, 2022 by NvL Recorect Link to comment Share on other sites More sharing options...
LordZiege 279 Posted July 28, 2022 Share Posted July 28, 2022 Debug game.core file? Link to comment Share on other sites More sharing options...
NvL 1 Posted July 28, 2022 Author Share Posted July 28, 2022 (edited) 13 minutes ago, LordZiege said: Debug game.core file? Core was generated by `./core1_1'. Program terminated with signal SIGSEGV, Segmentation fault. #0 boost::unordered_detail::hash_table<boost::unordered_detail::map<unsigned in t, boost::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::p air<unsigned int const, CNewPetActor*> > > >::begin (this=0x4, this=0x4) at ../../../Extern/include/boost/unordered/detail/fwd.hpp:500 500 iterator_base(); [Current thread is 1 (LWP 100135)] (gdb) bt full #0 boost::unordered_detail::hash_table<boost::unordered_detail::map<unsigned in t, boost::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::p air<unsigned int const, CNewPetActor*> > > >::begin (this=0x4, this=0x4) at ../../../Extern/include/boost/unordered/detail/fwd.hpp:500 No locals. #1 boost::unordered_map<unsigned int, CNewPetActor*, boost::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, CNewP etActor*> > >::begin (this=0x4) at ../../../Extern/include/boost/unordered/unordered_map.hpp:242 No locals. #2 CNewPetSystem::IsActivePet (this=0x0) at New_PetSystem.cpp:1163 iter = {<boost::iterator<std::forward_iterator_tag, std::pair<unsigned i nt const, CNewPetActor*>, int, std::pair<unsigned int const, CNewPetActor*>*, st d::pair<unsigned int const, CNewPetActor*>&>> = {<boost::detail::iterator_base<s td::forward_iterator_tag, std::pair<unsigned int const, CNewPetActor*>, int, std ::pair<unsigned int const, CNewPetActor*>*, std::pair<unsigned int const, CNewPe tActor*>&>> = {<std::iterator<std::forward_iterator_tag, std::pair<unsigned int const, CNewPetActor*>, int, std::pair<unsigned int const, CNewPetActor*>*, std:: pair<unsigned int const, CNewPetActor*>&>> = {<No data fields>}, <No data fields >}, <No data fields>}, base_ = {bucket_ = <optimized out>, node_ = <optimized out>}} state = false #3 0x0810eebc in CHARACTER::ExchangeStart (this=0x723839c0, --Type <RET> for more, q to quit, c to continue without paging--c victim=0x3c393680, dice=0 '\000') at exchange.cpp:74 iDist = <optimized out> dice_system = <optimized out> #4 0x0813c8c7 in CInputMain::Analyze (this=0x7166ea9c, d=0x7166ea00, bHeader=27 '\033', c_pData=0x723d5100 "\033") at input_main.cpp:3665 ch = <optimized out> __FUNCTION__ = "Analyze" iExtraLen = 0 #5 0x08127a73 in CInputProcessor::Process (this=0x7166ea9c, lpDesc=lpDesc@entry =0x7166ea00, c_pvOrig=0x723d5100, iBytes=iBytes@entry=32, r_iBytesProceed=@0xffb fb268: 0) at input.cpp:113 iExtraPacketSize = <optimized out> bHeader = 27 '\033' c_pszName = 0x724efa2c "Exchange" bLastHeader = 0 '\000' iLastPacketLen = 0 iPacketLen = 16 c_pData = 0x723d5100 "\033" iBytes = 32 r_iBytesProceed = @0xffbfb268: 0 this = 0x7166ea9c c_pvOrig = <optimized out> lpDesc = 0x7166ea00 c_pData = <optimized out> bLastHeader = <optimized out> iLastPacketLen = <optimized out> iPacketLen = <optimized out> bHeader = <optimized out> c_pszName = <optimized out> iExtraPacketSize = <optimized out> bSeq = <optimized out> bSeqReceived = <optimized out> #6 0x080fc253 in DESC::ProcessInput (this=this@entry=0x7166ea00) at desc.cpp:31 7 Edited July 28, 2022 by NvL Link to comment Share on other sites More sharing options...
Premium WeedHex 635 Posted July 28, 2022 Premium Share Posted July 28, 2022 (edited) IsActivePet (this=0x0) Show us this canc3r function It's shit about your pet system, I don't use it. Edited July 28, 2022 by WeedHex Link to comment Share on other sites More sharing options...
NvL 1 Posted July 28, 2022 Author Share Posted July 28, 2022 (edited) exchange.cpp:74 #ifdef ENABLE_NEW_PET_SYSTEM if (GetNewPetSystem()->IsActivePet()) { ChatPacket( CHAT_TYPE_INFO, LC_TEXT("nu deschide fereastra de schimb atunci cand animalul de companie nou")); return false; } if (victim->GetNewPetSystem()->IsActivePet()) { ChatPacket( CHAT_TYPE_INFO, LC_TEXT("nu deschide?i fereastra de schimb de victime atunci cand animalul de companie este nou")); return false; } #endif https://pastebin.com/QnAHkMWE .cpp https://pastebin.com/0xWAdKP2 .h Edited July 28, 2022 by NvL Link to comment Share on other sites More sharing options...
Premium WeedHex 635 Posted July 28, 2022 Premium Share Posted July 28, 2022 (edited) GetNewPetSystem()-> Was null pointer, so just check it. (Idk this system but seems such a sh1t xD) Edited July 28, 2022 by WeedHex Link to comment Share on other sites More sharing options...
NvL 1 Posted July 28, 2022 Author Share Posted July 28, 2022 C:\Users\kurys\Desktop\Server\game\questlua_petnew.cpp (9 hits) Line 31: CNewPetSystem* petSystem = ch->GetNewPetSystem(); Line 72: CNewPetSystem* petSystem = ch->GetNewPetSystem(); Line 88: CNewPetSystem* petSystem = ch->GetNewPetSystem(); Line 104: CNewPetSystem* petSystem = ch->GetNewPetSystem(); Line 125: CNewPetSystem* petSystem = ch->GetNewPetSystem(); Line 146: CNewPetSystem* petSystem = ch->GetNewPetSystem(); Line 166: CNewPetSystem* petSystem = ch->GetNewPetSystem(); Line 186: CNewPetSystem* petSystem = ch->GetNewPetSystem(); Line 235: CNewPetSystem* petSystem = ch->GetNewPetSystem(); C:\Users\kurys\Desktop\Server\game\shop_manager.cpp (1 hit) Line 12: if (pkChr->GetNewPetSystem()->IsActivePet()) C:\Users\kurys\Desktop\Server\game\char.h (1 hit) Line 76: CNewPetSystem* GetNewPetSystem() { return m_newpetSystem; } C:\Users\kurys\Desktop\Server\game\char_battle.cpp (8 hits) Line 33: if (to->GetNewPetSystem()) { Line 34: if (to->GetNewPetSystem()->IsActivePet() && to->GetNewPetSystem()->GetLevelStep() < 4) { Line 34: if (to->GetNewPetSystem()->IsActivePet() && to->GetNewPetSystem()->GetLevelStep() < 4) { Line 37: to->GetNewPetSystem()->SetExp(tmpexp, 0); Line 49: if (to->GetNewPetSystem()) { Line 50: if (to->GetNewPetSystem()->IsActivePet() && to->GetNewPetSystem()->GetLevelStep() < 4) { Line 50: if (to->GetNewPetSystem()->IsActivePet() && to->GetNewPetSystem()->GetLevelStep() < 4) { Line 53: to->GetNewPetSystem()->SetExp(tmpexp, 0); C:\Users\kurys\Desktop\Server\game\char_item.cpp (5 hits) Line 18: if (GetNewPetSystem()->IsActivePet() && item->GetVnum() >= 55701 && item->GetVnum() <= 55710) Line 30: if (GetNewPetSystem()->IsActivePet()) Line 53: if (GetNewPetSystem()->IsActivePet()) Line 115: if (GetNewPetSystem()->IsActivePet()){ChatPacket(CHAT_TYPE_INFO,LC_TEXT("PSS_PETI_GONDER"));return false;} Line 163: if (GetNewPetSystem()->IsActivePet()) C:\Users\kurys\Desktop\Server\game\cmd_general.cpp (15 hits) Line 54: if (ch->GetNewPetSystem()->IsActivePet()) Line 55: ch->GetNewPetSystem()->SetItemCube(pos, invpos); Line 75: if (ch->GetNewPetSystem()->IsActivePet()) Line 76: ch->GetNewPetSystem()->DoPetSkill(skillslot); Line 92: if (ch->GetNewPetSystem()->IsActivePet()) Line 93: ch->GetNewPetSystem()->ItemCubeFeed(feedtype); Line 106: if (ch->GetNewPetSystem()->IsActivePet()) { Line 129: int tmpevo = ch->GetNewPetSystem()->GetEvolution(); Line 131: if (ch->GetNewPetSystem()->GetLevel() == 40 && tmpevo == 0 || Line 132: ch->GetNewPetSystem()->GetLevel() == 60 && tmpevo == 1 || Line 133: ch->GetNewPetSystem()->GetLevel() == 80 && tmpevo == 2) { Line 149: ch->GetNewPetSystem()->IncreasePetEvolution(); Line 179: if (ch->GetNewPetSystem()->IsActivePet()) Line 220: if (ch->GetNewPetSystem()->IsActivePet()) Line 223: ch->ChatPacket(CHAT_TYPE_COMMAND, "OnResultPetAttrDetermine %d", ch->GetNewPetSystem()->GetPetType()); C:\Users\kurys\Desktop\Server\game\cmd_gm.cpp (1 hit) Line 28: if (ch->GetNewPetSystem()->IsActivePet()) C:\Users\kurys\Desktop\Server\game\exchange.cpp (2 hits) Line 10: if (GetNewPetSystem()->IsActivePet()) Line 16: if (victim->GetNewPetSystem()->IsActivePet()) Link to comment Share on other sites More sharing options...
NvL 1 Posted July 28, 2022 Author Share Posted July 28, 2022 (edited) I deleted this, I don't get crash core anymore, but the pet disappears exchange.cpp:74 #ifdef ENABLE_NEW_PET_SYSTEM if (GetNewPetSystem()->IsActivePet()) { ChatPacket( CHAT_TYPE_INFO, LC_TEXT("nu deschide fereastra de schimb atunci cand animalul de companie nou")); return false; } if (victim->GetNewPetSystem()->IsActivePet()) { ChatPacket( CHAT_TYPE_INFO, LC_TEXT("nu deschide?i fereastra de schimb de victime atunci cand animalul de companie este nou")); return false; } #endif Edited July 28, 2022 by NvL Link to comment Share on other sites More sharing options...
LordZiege 279 Posted July 28, 2022 Share Posted July 28, 2022 (edited) Try with: if (GetNewPetSystem() && GetNewPetSystem()->IsActivePet()) Edited July 28, 2022 by LordZiege Link to comment Share on other sites More sharing options...
Active Member iMerv3 768 Posted July 29, 2022 Active Member Share Posted July 29, 2022 (edited) #if defined(ENABLE_NEW_PET_SYSTEM) const CNewPetSystem* pNewPetSystem = GetNewPetSystem(); if (pNewPetSystem && pNewPetSystem->IsActivePet()) { ChatPacket( CHAT_TYPE_INFO, LC_TEXT("nu deschide fereastra de schimb atunci cand animalul de companie nou")); return false; } pNewPetSystem = victim ? victim->GetNewPetSystem() : NULL; if (pNewPetSystem && pNewPetSystem->IsActivePet()) { ChatPacket( CHAT_TYPE_INFO, LC_TEXT("nu deschide?i fereastra de schimb de victime atunci cand animalul de companie este nou")); return false; } #endif Edited July 29, 2022 by iMerv3 Link to comment Share on other sites More sharing options...
NvL 1 Posted July 29, 2022 Author Share Posted July 29, 2022 he does the same, the pet disappears bool CHARACTER::ExchangeStart(LPCHARACTER victim, BYTE dice) { if (this == victim) // 자기 자신과는 교환을 못한다. return false; if (IsObserverMode()) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("관전 상태에서는 교환을 할 수 없습니다.")); return false; } if (victim->IsNPC()) return false; //PREVENT_TRADE_WINDOW if ( IsOpenSafebox() || GetShopOwner() || GetMyShop() || IsCubeOpen() || GetOfflineShopOwner()) { ChatPacket( CHAT_TYPE_INFO, LC_TEXT("다른 거래창이 열려있을경우 거래를 할수 없습니다." ) ); return false; } if (GetGMLevel() > GM_PLAYER || victim->GetGMLevel() > GM_PLAYER) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Negocierea cu un player este interzisa.")); return false; } #ifdef ENABLE_NEW_PET_SYSTEM if (GetNewPetSystem()->IsActivePet()) { ChatPacket( CHAT_TYPE_INFO, LC_TEXT("nu deschide fereastra de schimb atunci cand animalul de companie nou")); return false; } if (GetNewPetSystem() && GetNewPetSystem()->IsActivePet()) { ChatPacket( CHAT_TYPE_INFO, LC_TEXT("nu deschideti fereastra de schimb de victime atunci cand animalul de companie este nou")); return false; } #endif if ( victim->IsOpenSafebox() || victim->GetShopOwner() || victim->GetMyShop() || victim->IsCubeOpen() || victim->GetOfflineShopOwner()) { ChatPacket( CHAT_TYPE_INFO, LC_TEXT("상대방이 다른 거래중이라 거래를 할수 없습니다." ) ); return false; } //END_PREVENT_TRADE_WINDOW int iDist = DISTANCE_APPROX(GetX() - victim->GetX(), GetY() - victim->GetY()); // 거리 체크 if (iDist >= EXCHANGE_MAX_DISTANCE) return false; if (GetExchange()) return false; if (victim->GetExchange()) { exchange_packet(this, EXCHANGE_SUBHEADER_GC_ALREADY, 0, 0, NPOS, 0, dice); return false; } if (victim->IsBlockMode(BLOCK_EXCHANGE)) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("상대방이 교환 거부 상태입니다.")); return false; } int dice_system = quest::CQuestManager::instance().GetEventFlag("dice_system"); if (dice == 1 && dice_system == 1) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("diceDISABLE")); return false; } SetExchange(M2_NEW CExchange(this, dice)); victim->SetExchange(M2_NEW CExchange(victim, dice)); victim->GetExchange()->SetCompany(GetExchange()); GetExchange()->SetCompany(victim->GetExchange()); // SetExchangeTime(); victim->SetExchangeTime(); exchange_packet(victim, EXCHANGE_SUBHEADER_GC_START, 0, GetVID(), NPOS, 0, dice); exchange_packet(this, EXCHANGE_SUBHEADER_GC_START, 0, victim->GetVID(), NPOS, 0, dice); return true; } Link to comment Share on other sites More sharing options...
NvL 1 Posted July 29, 2022 Author Share Posted July 29, 2022 (edited) I solved t/c Edited July 29, 2022 by NvL Link to comment Share on other sites More sharing options...
Recommended Posts