Welcome to the Builder Academy

Question medit - code assistance

More
08 Feb 2018 13:16 #7563 by cunning
Replied by cunning on topic medit - code assistance
I think I may have this solved. It was my stupidity from being sick for so long with walking Pneumonia.

I was so fixated on adding OLC_MOB(d) when I should have updated a few of my procedure calls to use descriptor_data *d instead of char_data *mob. Once I did that i passed the copy of the procs through to my updated command sets. Wallah, i was now not crashing and I was much much further along.

Thanks for the assistance. Lets see if I can bring this home now :)

Please Log in or Create an account to join the conversation.

More
08 Feb 2018 21:44 #7566 by cunning
Replied by cunning on topic medit - code assistance
Now its just a PIA to get it to save out internally correct...

Please Log in or Create an account to join the conversation.

More
09 Feb 2018 02:37 #7568 by WhiskyTest
Replied by WhiskyTest on topic medit - code assistance
Yay! Well done!
I was pretty lost, but sometimes its good to have a sounding board hey? :D

Please Log in or Create an account to join the conversation.

More
09 Feb 2018 23:30 #7571 by cunning
Replied by cunning on topic medit - code assistance
Well, its not been as good today. Almost all of this works, I can add new special procs to whatever line # i want. I can save it out, and it saves out correctly. However, that is where the problems begin. Anything doing with the current mob in the game or on reset crashes the game.

vstat displays the correct procs and I double checked the new mobile file and that is correct. I have the following debug. Every subcmd is correct, which is just making me SMH. I can go all the way to the last proc with no issue.

Feb 09 18:21:31 2018 :: AustinPowers: stat jupiter
Feb 09 18:21:37 2018 :: AustinPowers: vstat m 12038
Feb 09 18:21:48 2018 :: AustinPowers: zreset 120
Feb 09 18:21:48 2018 :: (GC) AustinPowers reset zone 120 (Rome)

Program received signal SIGSEGV, Segmentation fault.
0x00005555556f98bd in ?? ()
(gdb) back
#0 0x00005555556f98bd in ?? ()
#1 0x000055555557ec31 in special_procs (ch=ch@entry=0x555557203240, victim=victim@entry=0x0, obj=obj@entry=0x0, proc_type=proc_type@entry=3, spec_type=spec_type@entry=1,
dam=dam@entry=0x0, attacktype=0, tmp_desc=0x0) at spec_assign.c:332
#2 0x00005555556c20dc in mobile_activity () at mobact.c:96
#3 0x0000555555676f55 in heartbeat (heart_pulse=500) at comm.c:1043
#4 0x000055555567c792 in game_loop (local_mother_desc=3) at comm.c:978
#5 0x000055555556e841 in init_game (local_port=<optimized out>) at comm.c:565
#6 main (argc=<optimized out>, argv=<optimized out>) at comm.c:381
(gdb) up
#1 0x000055555557ec31 in special_procs (ch=ch@entry=0x555557203240, victim=victim@entry=0x0, obj=obj@entry=0x0, proc_type=proc_type@entry=3, spec_type=spec_type@entry=1,
dam=dam@entry=0x0, attacktype=0, tmp_desc=0x0) at spec_assign.c:332
332 check = (*MCMD(ch, subcmd).func)(ch, 0, strcpy(actbuf, ""), MCMD(ch, subcmd).num1, MCMD(ch, subcmd).num2, MCMD(ch, subcmd).num3, MCMD(ch, subcmd).num4, MCMD(ch, subcmd).num5, ch);
(gdb) info local
actbuf = '\000' <repeats 160 times>, "say Tick coming\r\nHey its Whirlwind/Wehr "...
check = <optimized out>
j = 0
subcmd = <optimized out>
temp = {damage = 0, attacktype = 0, resisttype = 0, attacker = 0x0}
device = {tmp_desc = 0x0, obj = 0x0}
(gdb) print ch->mob_specials.func[0]
$27 = {command = 80 'P', procs = 112, func = 0x55555557b450 <mob_armies>, freq = 100, name = 0x0, run_type = 1, term = 0, num1 = 0, num2 = 0, num3 = 0, num4 = 0, num5 = 0,
internal = 0, line = 1, next = 0x0}
(gdb) print ch->mob_specials.func[1]
$28 = {command = 80 'P', procs = 111, func = 0x55555557b600 <mob_purge_pets>, freq = 100, name = 0x0, run_type = 1, term = 0, num1 = 0, num2 = 0, num3 = 0, num4 = 0, num5 = 0,
internal = 0, line = 2, next = 0x0}
(gdb) print ch->mob_specials.func[2]
$29 = {command = 80 'P', procs = 98, func = 0x55555557b760 <mob_unaffects_self>, freq = 100, name = 0x0, run_type = 1, term = 0, num1 = 0, num2 = 0, num3 = 0, num4 = 0, num5 = 0,
internal = 0, line = 3, next = 0x0}
(gdb) print ch->mob_specials.func[3]
$30 = {command = 80 'P', procs = 133, func = 0x55555557c7b0 <mob_heal_from_damage>, freq = 100, name = 0x0, run_type = 2, term = 1, num1 = 100, num2 = 0, num3 = 0, num4 = 0,
num5 = 0, internal = 8, line = 4, next = 0x0}
(gdb) print ch->mob_specials.func[4]
$31 = {command = 80 'P', procs = 134, func = 0x55555557c950 <mob_cap_damage>, freq = 100, name = 0x0, run_type = 2, term = 1, num1 = 100, num2 = 0, num3 = 0, num4 = 0, num5 = 0,
internal = 6, line = 5, next = 0x0}
(gdb)

Please Log in or Create an account to join the conversation.

More
10 Feb 2018 02:44 #7573 by cunning
Replied by cunning on topic medit - code assistance
==13791== Jump to the invalid address stated on the next line
==13791== at 0x0: ???
==13791== by 0x143AF0: special_procs (spec_assign.c:332)
==13791== by 0x286F0B: mobile_activity (mobact.c:96)
==13791== by 0x227354: heartbeat (comm.c:1043)
==13791== by 0x22CB91: game_loop (comm.c:978)
==13791== by 0x122840: init_game (comm.c:565)
==13791== by 0x122840: main (comm.c:381)
==13791== Address 0x0 is not stack'd, malloc'd or (recently) free'd

Please Log in or Create an account to join the conversation.

More
10 Feb 2018 06:35 #7574 by WhiskyTest
Replied by WhiskyTest on topic medit - code assistance
What is happening in the code here: special_procs (spec_assign.c:332) ?

Please Log in or Create an account to join the conversation.

Time to create page: 0.236 seconds