Esempio n. 1
0
void do_dedit( char_data* ch, char* argument )
{
  wizard_data*    imm  = (wizard_data*) ch;
  exit_data*     exit;
  int           flags;
  int             dir;

  if( !get_flags( ch, argument, &flags, "1", "dedit" ) )
    return;

  if( matches( argument, "delete" ) ) {
    if( ( exit = (exit_data*) one_thing( ch, argument, "dedit delete", 
      (thing_array*) &ch->in_room->exits ) ) != NULL )
      delete_exit( imm, exit, is_set( &flags, 0 ) );
    return;
    }

  if( matches( argument, "new" ) ) {
    if( ( dir = direction_arg( argument ) ) != -1 ) 
      create_exit( imm, dir, argument, is_set( &flags, 0 ) );
    return;
    }

  if( ( exit = (exit_data*) one_thing( ch, argument, "dedit", 
    (thing_array*) &ch->in_room->exits ) ) == NULL )
    return;

  imm->exit_edit = exit;

  send( ch, "Dflag and dset now act on the exit %s.\n\r",
    dir_table[ exit->direction ].where );
}
Esempio n. 2
0
void change_exit_dir(struct room_data *rp, struct char_data *ch, char *arg,
                     int type) {
  int update;

  if (type != ENTER_CHECK) {
    if (!*arg || (*arg == '\n')) {
      ch->specials.edit = MAIN_MENU;
      update_room_menu(ch);
      return;
    }

    update = atoi(arg) - 1;
    if (update == -1) {
      change_exit_dir(rp, ch, "", ENTER_CHECK);
      return;
    }

    switch (update) {
    case 0:
      ch->specials.edit = CHANGE_EXIT_NORTH;
      add_exit_to_room(rp, ch, "", ENTER_CHECK);
      return;
      break;
    case 1:
      ch->specials.edit = CHANGE_EXIT_EAST;
      add_exit_to_room(rp, ch, "", ENTER_CHECK);
      return;
      break;
    case 2:
      ch->specials.edit = CHANGE_EXIT_SOUTH;
      add_exit_to_room(rp, ch, "", ENTER_CHECK);
      return;
      break;
    case 3:
      ch->specials.edit = CHANGE_EXIT_WEST;
      add_exit_to_room(rp, ch, "", ENTER_CHECK);
      return;
      break;
    case 4:
      ch->specials.edit = CHANGE_EXIT_UP;
      add_exit_to_room(rp, ch, "", ENTER_CHECK);
      return;
      break;
    case 5:
      ch->specials.edit = CHANGE_EXIT_DOWN;
      add_exit_to_room(rp, ch, "", ENTER_CHECK);
      return;
      break;
    case 6:
      ch->specials.edit = CHANGE_EXIT_DELETE;
      delete_exit(rp, ch, "", ENTER_CHECK);
      return;
      break;
    default:
      change_exit_dir(rp, ch, "", ENTER_CHECK);
      return;
    }

  }


  send_to_char(VT_HOMECLR, ch);
  send_to_charf(ch, "Room Name: %s", rp->name);
  send_to_charf(ch, VT_CURSPOS, 1, 40);
  send_to_charf(ch, "Room Number: %d", rp->number);
  send_to_charf(ch, VT_CURSPOS, 4, 1);
  send_to_char(exit_menu, ch);
  send_to_char("--> ", ch);
  return;
}