Replace mp_open_passage and mp_close_passage with the following two versions. If you don't use the CMDF macro and are still using DECLARE_DO_FUN just replace the CMDF( mp_*_passage ) bits with the appropriate stuff,
e.g. void mp_open_passage( CHAR_DATA* ch, char const* argument ). I THINK I changed all of the stuff necessary so that
modifications on your end aren't needed.


/*
 * Syntax mp_open_passage x y z
 *
 * opens a 1-way passage from room x to room y in direction z
 *
 *  won't mess with existing exits
 *  
 *  
 * Modified to allow for string based exit dirs
 * e.g. mpopenpassage x y n
 * -- Sept. 11, 2012, Andril
 * Further modified to allow for leaving off the fromRoom argument
 * e.g. mpopenpassage <toroom> <dir>
 * -- Bout an hour later, Andril
 */
CMDF( do_mp_open_passage )
{
   char arg1[MAX_INPUT_LENGTH];
   char arg2[MAX_INPUT_LENGTH];
   ROOM_INDEX_DATA *targetRoom, *fromRoom;
   int exit_num = -1;
   EXIT_DATA *pexit;

   if( IS_SET(ch->affected_by, AFF_CHARM) )
      return;

   if( !IS_NPC(ch) )
   {
      send_to_char( "Huh?\r\n", ch );
      return;
   }

   argument = one_argument( argument, arg1 );
   argument = one_argument( argument, arg2 );

   if( arg1[0] == '\0' )
   {
      progbug( "MpOpenPassage - Missing required first argument", ch );
      return;
   }

   if( arg2[0] == '\0' )
   {
      progbug( "MpOpenPassage - Missing required second argument", ch );
      return;
   }

   if( argument[0] == '\0' )
   {
      // assumed syntax: mpopenpassage <toroom> <dir>
      fromRoom = ch->in_room;
      if( is_number(arg1) )
      {
         targetRoom = get_room_index(atoi(arg1));
      }
      else
      {
         progbug("MpOpenPassage - Invalid target room value", ch );
         return;
      }

      if( is_number(arg2) )
      {
         exit_num = atoi(arg2);
      }
      else
      {
         exit_num = get_dir(arg2);
      }

      if( exit_num < DIR_NORTH || exit_num > DIR_SOUTHWEST )
      {
         progbug( "MpOpenPassage - invalid exit direction", ch );
         return;
      }

      if( targetRoom == NULL )
      {
         progbug( "MpOpenPassage - target room does not exist", ch );
         return;
      }
   }
   else
   {
      // original syntax: mpopenpassage <fromroom> <toroom> <dir>
      if( !is_number(arg1) )
      {
         progbug("MpOpenPassage - Invalid start room value: not a number", ch );
         return;
      }
      else
      {
         fromRoom = get_room_index(atoi(arg1));
      }

      if( fromRoom == NULL )
      {
         progbug("MpOpenPassage - Invalid from room value: room does not exist", ch );
         return;
      }

      if( !is_number(arg2) )
      {
         progbug("MpOpenPassage - Invalid target room value: not a number", ch );
         return;
      }
      else
      {
         targetRoom = get_room_index(atoi(arg2));
      }

      if( targetRoom == NULL )
      {
         progbug("MpOpenPassage - Invalid target room value: room does not exist", ch );
         return;
      }

      if( is_number(argument) )
      {
         exit_num = atoi(argument);
      }
      else
      {
         exit_num = get_dir(argument);
      }

      if( exit_num < DIR_NORTH || exit_num > DIR_SOUTHWEST )
      {
         progbug("MpOpenPassage - Invalid exit value", ch );
         return;
      }
   }
   if( ( pexit = get_exit( fromRoom, exit_num ) ) != NULL )
   {
      if( !IS_SET( pexit->exit_info, EX_PASSAGE ) )
         return;
      progbug( "MpOpenPassage - Exit exists", ch );
      return;
   }

   pexit = make_exit( fromRoom, targetRoom, exit_num );
   pexit->keyword = STRALLOC( "" );
   pexit->description = STRALLOC( "" );
   pexit->key = -1;
   pexit->exit_info = EX_PASSAGE;
}


/*
 * Syntax mp_close_passage x y
 *
 * closes a passage in room x leading in direction y
 *
 * the exit must have EX_PASSAGE set
 * 
 * Modified the syntax to use word directions e.g.
 * mpclosepassage x n
 * -- Sept. 11, 2012, Andril
 */
CMDF( do_mp_close_passage )
{
   char arg1[MAX_INPUT_LENGTH];
   ROOM_INDEX_DATA *fromRoom;
   EXIT_DATA *pexit;

   if( IS_SET(ch->affected_by, AFF_CHARM) )
      return;

   if( !IS_NPC(ch) )
   {
      send_to_char( "Huh?\r\n", ch );
      return;
   }

   argument = one_argument( argument, arg1 );

   if( arg1[0] == '\0' )
   {
      progbug( "MpClosePassage - Missing required first argument", ch );
      return;
   }

   if( argument[0] == '\0' )
   {
      // assumed syntax: mpclosepassage <dir>
      fromRoom = ch->in_room;
      if( is_number( arg1 ) )
      {
         if( ( pexit = get_exit( fromRoom, atoi( arg1 ) ) ) == NULL )
         {
            return;  /* already closed, ignore...  so rand_progs */
            /*
            * can close without spam 
            */
         }
      }
      else if( (pexit = get_exit( fromRoom, get_dir( arg1 ) ) ) == NULL )
      {
         return; // still already closed
      }
   }
   else
   {
      // original syntax: mpclosepassage <room> <dir>
      if( is_number(arg1) )
      {
         fromRoom = get_room_index( atoi(arg1) );
      }
      else
      {
         fromRoom = get_room_index(get_dir(arg1));
      }

      if( is_number( argument ) )
      {
         if( ( pexit = get_exit( fromRoom, atoi( argument ) ) ) == NULL )
         {
            return;  /* already closed, ignore...  so rand_progs */
            /*
            * can close without spam 
            */
         }
      }
      else if( (pexit = get_exit( fromRoom, get_dir( argument ) )) == NULL )
      {
         return; // still already closed
      }
   }

   if( fromRoom == NULL )
   {
      progbug( "MpClosePassage - from room does not exist", ch );
      return;
   }

   if( pexit == NULL )
   {
      progbug( "MpClosePassage - exit does not exist", ch );
      return;
   }

   if( !IS_SET( pexit->exit_info, EX_PASSAGE ) )
   {
      progbug( "MpClosePassage - Exit not a passage", ch );
      return;
   }

   extract_exit( fromRoom, pexit );
}
