[Question][Newbie] Dig

From: Dust (dustlos@hotmail.com)
Date: 04/22/01


On my new mud i put in dig and allowed it to make new rooms if needed
(taking code from my old mud), however I want to stop it from allowing a
person to link zones with dig (random typos can screw up the world rather
easily) and I've been coming up blank with attempts at this so I'll post
some code here and hope someone can point me straight, thanks.

  iroom = atoi(buf3);
  rroom = real_room(iroom);
  zone_in = real_zone_by_thing(world[ch->in_room].number);

   if (!*buf2) {
    send_to_char("Format: dig <dir> <room number>\r\n", ch);
    return; }
   else if (!*buf3) {
    send_to_char("Format: dig <dir> <room number>\r\n", ch);
    return;
   }
   if (rroom <= 1) {
     CREATE(d->olc, struct oasis_olc_data, 1);
     OLC_ZNUM(d) = real_zone_by_thing(iroom);
     if (OLC_ZNUM(d) == -1) {
       send_to_char("The zone of target room doesn't exists.\r\n", ch);
       cleanup_olc(d, CLEANUP_ALL);
       cleanup_olc(d, CLEANUP_STRUCTS);
       return;
     }
     if (OLC_ZNUM(d) != world[ch->in_room].zone) {
       sprintf(buf, "You have to manually link zones.\r\n");
       send_to_char(buf, ch);
       cleanup_olc(d, CLEANUP_ALL);
       cleanup_olc(d, CLEANUP_STRUCTS);
       return;
     }

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/05/01 PST