Loop Problem

From: Wesley Fonvergne (tadrith@GATEKEEP.NET)
Date: 03/07/98


        I have been working at this all day, and I can't get ANYWHERE with it.
Maybe it's because I'm a semi-new coder, maybe it's because I'm self
taught, who knows. Anyways, I want this function to load specific mobs in
a specific room. The number of the mobs is random. This is for invasion
code... heh heh heh...mob is randomly based, by the value of an integer,
which is determined elsewhere. City is also value based, but it is chose
by the "siege" command. The problem with this is that it doesn't load the
number of mobs...it just loads until it can't load anymore. :(
invasion_size is the size variable in this... can someone tell me why it
won't stop loading mobs?

Word wrap messed up the first extern...that is really all one line.
Sorry, this is sort of messy, too. :)


****** snippet ********


void begin_invasion(void)
{
 extern sh_int find_target_room(struct char_data * ch, char
*rawroomstr);

 int r_num, mob_num;
 struct char_data *mob;
 extern char *invade_room;
 int invasion_size = number(25, 50);
 int location;
 int i;

 switch (mob_to_invade) {
   case 1:
     mob_num = 1250;
     r_num = real_mobile(mob_num);
     mob = read_mobile(r_num, REAL);
     break;
   case 2:
     mob_num = 1251;
     r_num = real_mobile(mob_num);
     mob = read_mobile(r_num, REAL);
     break;
   case 3:
     mob_num = 1252;
     r_num = real_mobile(mob_num);
     mob = read_mobile(r_num, REAL);
     break;
   default:
     r_num = 1000;
     mob = read_mobile(r_num, REAL);
     break;
  }

 switch (invade_city) {
   case 1:
    invade_room = "2010";
    location = find_target_room(mob, invade_room);
    break;
  default:
    invade_room = "1000";
    location = find_target_room(mob, invade_room);
    break;
   }

 for (i = 0; i << invasion_size; i++) {
   char_to_room(mob, location);
   break;
  }
}

                [ Tadrith Skandrakae, Implementor of Dreamscape ]
                [     - telnet://mud.dreamscape.org:1234/ -     ]
                ["I lay my dreams before your feet;             ]
                [    tread softly, for you tread on my dreams.  ]

     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



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