Re: scan command...

jelson@blaze.cs.jhu.edu
Date: 03/16/94


> Here's a sample of the code:
> 
>  sprintf(buf, "$n scans around intently.");

Sort of an error.  Why not just use strcpy()?

>   current_room = real_room(ch->in_room);

Wrong.  ch->in_room is already a real room number; calling real_room on it
is an error.

>   act(buf, TRUE, ch, 0, 0, TO_ROOM);

Why bother with the sprintf() at the top, or even a strcpy()?  You can
just rewrite this line as: act("$n scans...", TRUE, ch, 0, 0, TO_ROOM);

>   buf[0] = '\0';
>   switch(*type) {
>   case 'o': case 'O': case 'i': case 'I':
>    send_to_char("You scan around and find the items around are-\n\r\n\r",ch);
>     for (j = current_room->contents; j; j = j->next_content) {

Wrong.  current_room is an integer.  j is presumably a pointer to an
object.  This should read:
      for (j = world[ch->in_room].contents; j; j = j->next_content) {


-je



This archive was generated by hypermail 2b30 : 12/07/00 PST