Welcome to the Builder Academy

Question Old circle mud snippet problem

More
25 Jul 2012 15:38 #435 by bakarus
I was trying to use an old snippet from the circle mud list, Recharge snippet

I fixed all of the send_to_char issues being reversed, but when I get to this section it gives me an error,
Code:
if (!(obj = get_obj_in_list_vis(ch, buf, ch->carrying))) { send_to_char("You don't have that!\r\n", ch); return (TRUE); }

It errors on the first line there, and gives this:

spec.procs.c:310 warning: passing argument 3 of 'get_obj_in_list_vis' from incompatible pointer type
spec_procs.c310: error: too few arguments to function 'get_obj_in_list_vis'

spec_procs.c line 310 is the first line in the above code.

Thanks for any help :)

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

More
25 Jul 2012 16:00 #436 by Liko

bakarus wrote: I was trying to use an old snippet from the circle mud list, Recharge snippet

I fixed all of the send_to_char issues being reversed, but when I get to this section it gives me an error,

Code:
if (!(obj = get_obj_in_list_vis(ch, buf, ch->carrying))) { send_to_char("You don't have that!\r\n", ch); return (TRUE); }

It errors on the first line there, and gives this:

spec.procs.c:310 warning: passing argument 3 of 'get_obj_in_list_vis' from incompatible pointer type
spec_procs.c310: error: too few arguments to function 'get_obj_in_list_vis'

spec_procs.c line 310 is the first line in the above code.

Thanks for any help :)



try
Code:
if (!(get_obj_in_list_vis(ch, buf, NULL, ch->carrying))) { send_to_char("You don't have that!\r\n", ch); return (TRUE); }

Randian(0.0.0)
Owner/Developer
The following user(s) said Thank You: bakarus

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

More
25 Jul 2012 16:24 #438 by bakarus
Works like a champ now, thanks :)

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

More
25 Jul 2012 20:45 - 25 Jul 2012 20:46 #440 by bakarus
actually it worked great, until i tried it a few more times, then the mud crashed. I looked through everything and did a new 'make' and got the following warning:

spec_procs.c: In function 'recharge':
spec_procs.c:310: warning: 'obj' is used uninitialized in this function

Line 310 is the line i added the NULL, to earlier, same one from original post.

Now whenever i try to type 'recharge <wand or staff>' the mud crashes.

Syslog shows: Jul 25 13:32:55 :: SYSERR: Received SIGHUP, SIGINT, or SIGTERM. Shutting down...

not sure what's blowing up here.
Last edit: 25 Jul 2012 20:46 by bakarus.

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

More
26 Jul 2012 01:35 - 26 Jul 2012 01:37 #441 by Liko

bakarus wrote: actually it worked great, until i tried it a few more times, then the mud crashed. I looked through everything and did a new 'make' and got the following warning:

spec_procs.c: In function 'recharge':
spec_procs.c:310: warning: 'obj' is used uninitialized in this function

Line 310 is the line i added the NULL, to earlier, same one from original post.

Now whenever i try to type 'recharge <wand or staff>' the mud crashes.

Syslog shows: Jul 25 13:32:55 :: SYSERR: Received SIGHUP, SIGINT, or SIGTERM. Shutting down...

not sure what's blowing up here.


can give me a gdb back log?

If you don't know how to do it, here is a link Gdb Link

Randian(0.0.0)
Owner/Developer
Last edit: 26 Jul 2012 01:37 by Liko.

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

More
26 Jul 2012 02:02 #442 by bakarus
Program received signal SIGSEGV, Segmentation fault.
recharge (ch=0x9140808, me=0x8d760f8, cmd=590, argument=0xbfffd28c " wand")
at spec_procs.c:316
316 if (GET_OBJ_TYPE(obj) != ITEM_STAFF &&
(gdb) bt
#0 recharge (ch=0x9140808, me=0x8d760f8, cmd=590, argument=0xbfffd28c " wand")
at spec_procs.c:316
#1 0x080e43b6 in special (ch=0x9140808, cmd=590, arg=0xbfffd28c " wand")
at interpreter.c:999
#2 0x080e7ed9 in command_interpreter (ch=0x9140808,
argument=0xbfffd284 "recharge wand") at interpreter.c:584
#3 0x0809b91b in game_loop (local_mother_desc=7) at comm.c:885
#4 0x0809cd27 in init_game (argc=0, argv=0xbfffd804) at comm.c:529
#5 main (argc=0, argv=0xbfffd804) at comm.c:354
(gdb)

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

Time to create page: 0.200 seconds