Old circle mud snippet problem

  • bakarus
  • bakarus's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
6 years 2 months ago #435 by bakarus
Old circle mud snippet problem was created 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,
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
6 years 2 months ago #436 by Liko
Replied by Liko on topic Old circle mud snippet problem

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,

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
if (!(get_obj_in_list_vis(ch, buf, NULL, ch->carrying)))
    {
      send_to_char("You don't have that!\r\n", ch);
      return (TRUE);
    }

DragonBall: Tournament (1.2.0)
Owner/Developer
The following user(s) said Thank You: bakarus

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

  • bakarus
  • bakarus's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
6 years 2 months ago #438 by bakarus
Replied by bakarus on topic Old circle mud snippet problem
Works like a champ now, thanks :)

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

  • bakarus
  • bakarus's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
6 years 2 months ago - 6 years 2 months ago #440 by bakarus
Replied by bakarus on topic Old circle mud snippet problem
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: 6 years 2 months ago by bakarus.

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

More
6 years 2 months ago - 6 years 2 months ago #441 by Liko
Replied by Liko on topic Old circle mud snippet problem

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

DragonBall: Tournament (1.2.0)
Owner/Developer
Last edit: 6 years 2 months ago by Liko.

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

  • bakarus
  • bakarus's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
6 years 2 months ago #442 by bakarus
Replied by bakarus on topic Old circle mud snippet problem
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.

  • bakarus
  • bakarus's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
6 years 2 months ago #443 by bakarus
Replied by bakarus on topic Old circle mud snippet problem
the line in spec_procs.c:316 is this code block
310  if (!(obj == get_obj_in_list_vis(ch, buf, NULL, ch->carrying)))
311         {
312             send_to_char(ch, "You don't have that!\r\n");
313             return (TRUE);
314         }
315        if (GET_OBJ_TYPE(obj) != ITEM_STAFF &&
316        GET_OBJ_TYPE(obj) != ITEM_WAND)
317       {
318             send_to_char(ch, "Are you daft!  You can't recharge that!\r\n");
320             return (TRUE);
321       }

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

More
6 years 2 months ago #444 by Liko
Replied by Liko on topic Old circle mud snippet problem

bakarus wrote: the line in spec_procs.c:316 is this code block

310  if (!(obj == get_obj_in_list_vis(ch, buf, NULL, ch->carrying)))
311         {
312             send_to_char(ch, "You don't have that!\r\n");
313             return (TRUE);
314         }
315        if (GET_OBJ_TYPE(obj) != ITEM_STAFF &&
316        GET_OBJ_TYPE(obj) != ITEM_WAND)
317       {
318             send_to_char(ch, "Are you daft!  You can't recharge that!\r\n");
320             return (TRUE);
321       }


I'm not sure if it matters or not, but line 310 should be like this
if (!(obj = get_obj_in_list_vis(ch, buf, NULL, ch->carrying)))

All I took out was one of the equal signs.

DragonBall: Tournament (1.2.0)
Owner/Developer
The following user(s) said Thank You: bakarus

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

  • bakarus
  • bakarus's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
More
6 years 2 months ago #446 by bakarus
Replied by bakarus on topic Old circle mud snippet problem
That seemed to fix it, tested it a bunch and its still working w/o errors. No idea where that spare = came from :)

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

Time to create page: 2.041 seconds