Jump to content

Question

Posted

Hi, all somebody can help me to read this error

Program received signal SIGSEGV, Segmentation fault.
itemdb_isequip2 (id=id@entry=0x0) at itemdb.cpp:487
487             switch (id->type) {
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) n
Program not restarted.
(gdb) bt full
#0  itemdb_isequip2 (id=id@entry=0x0) at itemdb.cpp:487
No locals.
#1  0x0000555555666ec4 in pc_equippoint_sub (sd=0x55555bfdfc90, id=0x0) at pc.cpp:868
No locals.
#2  0x00005555555e7a4a in clif_parse_equipswitch_request_single (fd=<optimized out>,
    sd=0x55555bfdfc90) at clif.cpp:20929
        index = 29
#3  0x00005555555d5165 in clif_parse (fd=19) at clif.cpp:21070
        cmd = <optimized out>
        packet_len = 4
        sd = <optimized out>
        pnum = 0
        cmd = <optimized out>
        packet_len = <optimized out>
        sd = <optimized out>
        pnum = <optimized out>
#4  clif_parse (fd=19) at clif.cpp:20937
        cmd = <optimized out>
        packet_len = <optimized out>
        sd = <optimized out>
#5  0x0000555555578535 in main () at /usr/include/c++/8/bits/shared_ptr_base.h:1147
No symbol table info available.

its becaouse switch equipment feature??

3 answers to this question

Recommended Posts

  • 0
Posted (edited)

Open ../src/map/clif.cpp and change code of the function "clif_parse_equipswitch_request_single" from:

void clif_parse_equipswitch_request_single( int fd, struct map_session_data* sd ){
#if PACKETVER >= 20170502
	uint16 index = RFIFOW(fd, 2) - 2;

	if( !battle_config.feature_equipswitch ){
		return;
	}

	// Check if the index is valid
	if( index >= MAX_INVENTORY ){
		return;
	}

	// Check if the item was already added to equip switch
	if( sd->inventory.u.items_inventory[index].equipSwitch ){
		if( sd->npc_id ){
#ifdef RENEWAL
			if( pc_hasprogress( sd, WIP_DISABLE_SKILLITEM ) ){
				clif_msg( sd, WORK_IN_PROGRESS );
				return;
			}
#endif
			if( !sd->npc_item_flag ){
				return;
			}
		}

		pc_equipswitch( sd, index );
	}else{
		pc_equipitem( sd, index, pc_equippoint(sd, index), true );
	}
#endif
}

to:

void clif_parse_equipswitch_request_single( int fd, struct map_session_data* sd ){
#if PACKETVER >= 20170502
	uint16 index = RFIFOW(fd, 2) - 2;

	if( !battle_config.feature_equipswitch ){
		return;
	}

	// Check if the index is valid
	if( index >= MAX_INVENTORY ){
		return;
	}

	// Check if the item exists
	if( sd->inventory_data[index] == nullptr ){
		return;
	}

	// Check if the item was already added to equip switch
	if( sd->inventory.u.items_inventory[index].equipSwitch ){
		if( sd->npc_id ){
#ifdef RENEWAL
			if( pc_hasprogress( sd, WIP_DISABLE_SKILLITEM ) ){
				clif_msg( sd, WORK_IN_PROGRESS );
				return;
			}
#endif
			if( !sd->npc_item_flag ){
				return;
			}
		}

		pc_equipswitch( sd, index );
		return;
	}

	pc_equipitem( sd, index, pc_equippoint(sd, index), true );
	
#endif
}

 

Edited by Functor
  • Upvote 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...