Re: A 'home' made bug...

From: Skylar (skylar@ifconfig.intserv.com)
Date: 04/16/96


On Tue, 16 Apr 1996, corey hoitsma wrote:
> 
> Hi all!
> Sorry that it seems to be that I am asking tons of questions and not
> contributing.. well sorry.. maybe I can once I get better:P
> 
> Anyways.. I have a bug in the do_home command I've made.. here's the code
> I have for it:
> 
> ACMD(do_home)
> {
>   struct descriptor_data *d;
>   sh_int load_room;
>   struct char_data *victim;
>   d = descriptor_list;
>  
>  if (GET_LOADROOM(d->character) == 3005) {
>     send_to_char("You don't have a house!", ch);
>     return;
> } else {
>   act("$n runs home!", TRUE, ch, 0, 0, TO_ROOM);
>   char_from_room(victim);
>   char_to_room(victim, GET_LOADROOM(d->character));
>   act("$n is glade to be home!", TRUE, ch, 0, 0, TO_ROOM);
>   look_at_room(victim, 0);
>        }
> }
> 
> On the   if (GET_LOADROOM(d->character) == 3005) {  line I don't really
> know what the LOADROOM would be set to in the begining... you know 

Erm... you don't seem to be setting victim to anything for one,
also, I think you can just do away with victim and the pointer
to the descriptor and simply use ch, thats who's going home right?
the guy who types the command?  For what the load room is in the beginning,
you'll find that in config.c .. mortal_start_room I believe.  Maybe this
will work for ya...

--cut--
extern sh_int mortal_start_room;

ACMD(do_home)
{
 
  if (GET_LOADROOM(ch) == mortal_start_room) 
    send_to_char("You don't have a house!\r\n", ch);
  else {
    act("$n clicks $s heels three times.", TRUE, ch, 0, 0, TO_ROOM);
    char_from_room(ch);
    char_to_room(ch, GET_LOADROOM(ch));
    act("$n is glad to be home!", TRUE, ch, 0, 0, TO_ROOM);
    look_at_room(ch, 0);
  }
}
--cut--



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