Sziasztok, úgy fél nappal ez előtt elkezdtem bevarázsolni a pánt rendszert, amit már életelemben 100x beraktam tuti. Minden működik is 100% -ra rajta ( unbugged ). Csak nekem volt bent egy rendszer (ZeNu féle mount rendszer)
(https://kepkuldes.com/images/724fb3c8eefe98d1730e602c9936d331.jpg)
Ergo sétál melledet a mount és CTRL+G vel felugrasz meg le ( costume mountot használ ). Amíg fent van a costume ablakban melledet fog sétálni. Tehát ez is 100% ig működött.
Mikor bevarázsoltam a pánt rendszert eléggé elszaródott. Átnéztem az összes kódot, hol ütközhettek volna meg minden.
Annyira működik még a mount ,hogy felveszi előhívja és egyhelybe áll még akkor is a lefutod a maratont. És amint rá ülnél vagy le vennéd a pecsétet a szerver leáll. Átnéztem ezt a részét is ,sehol nem kapott el semmi.
Majd debugoltam a game filet. Említi a mountokat természetesen
for (TMapBuffOnAttrs::iterator it = m_map_buff_on_attrs.begin(); it != m_map_buff_on_attrs.end(); it++)
{
if (NULL != it->second)
{
M2_DELETE(it->second);
}
}
Egyik sor amire panaszkodik M2_DELETE(it->second); nevéből addódoan gondolom valamit töröl, nem tudtam rá jönni mire van
Vagy például a "unsummon" nál erre :
#ifdef ENABLE_MOUNT_COSTUME_SYSTEM
if (IsMountItem())
m_pOwner->MountUnsummon(this);
#endif
Debugoltam a core-t átlathatóan és fullosan, esetleg egy rávezetést megköszönnék
#0 CBuffOnAttributes::Off (this=0x1010101) at buff_on_attributes.cpp:176
#1 0x082453e1 in ~CBuffOnAttributes (this=0x1010101) at buff_on_attributes.cpp:16
#2 0x0807f914 in CHARACTER::Destroy (this=0x6ca7f000) at char.cpp:590
#3 0x08082ab6 in ~CHARACTER (this=0x6ca7f000) at char.cpp:135
#4 0x080b50be in CHARACTER_MANAGER::DestroyCharacter (this=0xffffc62c, ch=0x6ca7f000) at char_manager.cpp:165
#5 0x0806b828 in CMountActor::Unsummon (this=0x6c9c2070) at MountSystem.cpp:135
#6 0x0806c2bf in CMountSystem::Unsummon (this=0x6c449980, vnum=20114, bDeleteFromList=false) at MountSystem.cpp:429
#7 0x08075718 in CHARACTER::MountUnsummon (this=0x6c554800, mountItem=0x2ae88f60) at char.cpp:7397
#8 0x08164a54 in CItem::Unequip (this=0x2ae88f60) at item.cpp:1114
#9 0x08164b18 in CItem::RemoveFromCharacter (this=0x2ae88f60) at item.cpp:300
#10 0x080a0dfb in CHARACTER::UnequipItem (this=0x6c554800, item=0x2ae88f60) at char_item.cpp:6935
#11 0x080a73f7 in CHARACTER::UseItemEx (this=0x6c554800, item=0x2ae88f60, DestCell={window_type = 0 '\0', cell = 65535}) at char_item.cpp:2411
#12 0x080b2247 in CHARACTER::UseItem (this=0x6c554800, Cell={window_type = 1 '\001', cell = 201}, DestCell={window_type = 0 '\0', cell = 65535}) at char_item.cpp:6007
#13 0x081597cf in CInputMain::Analyze (this=0x6c1c341c, d=0x6c1c3380, bHeader=<value optimized out>, c_pData=0x6c5ceb80 "\v\001▒") at input_main.cpp:3288
#14 0x08141e1b in CInputProcessor::Process (this=0x6c1c341c, lpDesc=0x6c1c3380, c_pvOrig=0x6c5ceb80, iBytes=5, r_iBytesProceed=@0xffffa554) at input.cpp:103
#15 0x0810a473 in DESC::ProcessInput (this=0x6c1c3380) at desc.cpp:313
#16 0x082694b4 in io_loop (fdw=0x2916b380) at main.cpp:988
#17 0x08269ee1 in idle () at main.cpp:865
#18 0x0826b533 in main (argc=1, argv=0xffffdc34) at main.cpp:526
#0 CBuffOnAttributes::Off (this=0x1010101) at buff_on_attributes.cpp:176
No locals.
#1 0x082453e1 in ~CBuffOnAttributes (this=0x1010101) at buff_on_attributes.cpp:16
No locals.
#2 0x0807f914 in CHARACTER::Destroy (this=0x6ca7f000) at char.cpp:590
pkEvent = {px = 0x6b9fecdc}
party = <value optimized out>
#3 0x08082ab6 in ~CHARACTER (this=0x6ca7f000) at char.cpp:135
No locals.
#4 0x080b50be in CHARACTER_MANAGER::DestroyCharacter (this=0xffffc62c, ch=0x6ca7f000) at char_manager.cpp:165
it = {<std::tr1::__detail::_Hashtable_iterator_base<std::pair<const unsigned int, CHARACTER*>,false>> = {_M_cur_node = 0x6ca60f10, _M_cur_bucket = 0x6bace6f8}, <No data fields>}
__FUNCTION__ = "DestroyCharacter"
#5 0x0806b828 in CMountActor::Unsummon (this=0x6c9c2070) at MountSystem.cpp:135
No locals.
#6 0x0806c2bf in CMountSystem::Unsummon (this=0x6c449980, vnum=20114, bDeleteFromList=false) at MountSystem.cpp:429
actor = (CMountActor *) 0x6c9c2070
bActive = <value optimized out>
__FUNCTION__ = "Unsummon"
#7 0x08075718 in CHARACTER::MountUnsummon (this=0x6c554800, mountItem=0x2ae88f60) at char.cpp:7397
mountSystem = (CMountSystem *) 0x6c449980
mobVnum = 20114
#8 0x08164a54 in CItem::Unequip (this=0x2ae88f60) at item.cpp:1114
dwImmuneFlag = <value optimized out>
item = <value optimized out>
__FUNCTION__ = "Unequip"
#9 0x08164b18 in CItem::RemoveFromCharacter (this=0x2ae88f60) at item.cpp:300
__FUNCTION__ = "RemoveFromCharacter"
#10 0x080a0dfb in CHARACTER::UnequipItem (this=0x6c554800, item=0x2ae88f60) at char_item.cpp:6935
pos = 0
#11 0x080a73f7 in CHARACTER::UseItemEx (this=0x6c554800, item=0x2ae88f60, DestCell={window_type = 0 '\0', cell = 65535}) at char_item.cpp:2411
item2 = <value optimized out>
iLimitRealtimeStartFirstUseFlagIndex = 1
wDestCell = 65535
bDestInven = 0 '\0'
__FUNCTION__ = "UseItemEx"
b1 = {{count = 1000, prob = 302, vnum = 1}, {count = 10, prob = 150, vnum = 27002}, {count = 10, prob = 75, vnum = 27003}, {count = 10, prob = 100, vnum = 27005}, {count = 10, prob = 50,
vnum = 27006}, {count = 10, prob = 80, vnum = 27001}, {count = 10, prob = 50, vnum = 27002}, {count = 10, prob = 80, vnum = 27004}, {count = 10, prob = 50, vnum = 27005}, {count = 1, prob = 10,
vnum = 50300}, {count = 1, prob = 6, vnum = 92}, {count = 1, prob = 2, vnum = 132}, {count = 1, prob = 6, vnum = 1052}, {count = 1, prob = 2, vnum = 1092}, {count = 1, prob = 6, vnum = 2082}, {
count = 1, prob = 2, vnum = 2122}, {count = 1, prob = 6, vnum = 3082}, {count = 1, prob = 2, vnum = 3122}, {count = 1, prob = 6, vnum = 5052}, {count = 1, prob = 2, vnum = 5082}, {count = 1, prob = 6,
vnum = 7082}, {count = 1, prob = 2, vnum = 7122}, {count = 1, prob = 1, vnum = 11282}, {count = 1, prob = 1, vnum = 11482}, {count = 1, prob = 1, vnum = 11682}, {count = 1, prob = 1, vnum = 11882}}
prob_table_euckr = {80, 90, 97}
prob_table_gb2312 = {95, 97, 99}
#12 0x080b2247 in CHARACTER::UseItem (this=0x6c554800, Cell={window_type = 1 '\001', cell = 201}, DestCell={window_type = 0 '\0', cell = 65535}) at char_item.cpp:6007
vid = <value optimized out>
oldCount = <value optimized out>
vnum = <value optimized out>
len = <value optimized out>
ret = <value optimized out>
hint = "\b̦▒(L▒▒▒j\026▒(\001\000\000\000̮Zl▒\aSGP▒▒▒|▒▒▒\000\000\000\000▒\aSGX▒▒▒\214▒▒▒\000\000\000\000̦▒("
wCell = <value optimized out>
window_type = <value optimized out>
item = 0x2ae88f60
#13 0x081597cf in CInputMain::Analyze (this=0x6c1c341c, d=0x6c1c3380, bHeader=<value optimized out>, c_pData=0x6c5ceb80 "\v\001▒") at input_main.cpp:3288
ch = 0x6c554800
iExtraLen = <value optimized out>
__FUNCTION__ = "Analyze"
#14 0x08141e1b in CInputProcessor::Process (this=0x6c1c341c, lpDesc=0x6c1c3380, c_pvOrig=0x6c5ceb80, iBytes=5, r_iBytesProceed=@0xffffa554) at input.cpp:103
iExtraPacketSize = <value optimized out>
bHeader = 11 '\v'
c_pszName = 0x6c5a560c "ItemUse"
c_pData = 0x6c5ceb80 "\v\001▒"
A szöveget elolvasva lehet elsőre egy dangling pointerre gondolnék. Ergo már felszabadítottad a memóriaterületet, nem null (mivel átment az ellenőrzésen) és törölni akarod. Aztán pont emiatt, mivel nem férhetnél hozzá, az oprendszer kilővi a játékot. Ezért használunk intelligens pointereket. Nézd végig hol törlődhetett még hamarabb.
Köszönöm szépen ;)
#ifdef ENABLE_MOUNT_COSTUME_SYSTEM
if (m_mountSystem)
{
m_mountSystem->Destroy();
delete m_mountSystem;
m_mountSystem = 0;
}
if(GetMountVnum())
{
RemoveAffect(AFFECT_MOUNT);
RemoveAffect(AFFECT_MOUNT_BONUS);
}
HorseSummon(false);
#endif
#ifdef __PET_SYSTEM__
if (m_petSystem)
{
m_petSystem->Destroy();
delete m_petSystem;
m_petSystem = 0;
}
#endif
//HorseSummon(false);
Kétszert váltotta át falsere //HorseSummon(false);