This is one of the very first things I changed, so it's modified very crudely. It produces and exit listing like in many diku muds.
/* Function modified from original form - Samson 1-25-98 */
CMDF do_exits( CHAR_DATA *ch, char *argument )
{
char buf[MSL], exitbuf[256] = "";
EXIT_DATA *pexit;
bool found;
bool fAuto;
bool eClosed; /* Used to hold if the exit is saved or not -- Cynshard*/
int spaces; /* Used to format output -- Cynshard */
buf[0] = '�';
fAuto = !str_cmp( argument, "auto" );
if ( !check_blind(ch) )
return;
if( fAuto && MXP_ON( ch ) )
send_to_char( MXP_TAG_ROOMEXIT, ch );
set_char_color( AT_EXITS, ch );
mudstrlcpy( buf, fAuto ? "Obvious exits:\r\n" : "Obvious exits:\r\n", MSL ); /* Changed -- Cynshard */
found = FALSE;
for ( pexit = ch->in_room->first_exit; pexit; pexit = pexit->next )
{
eClosed = ( IS_EXIT_FLAG(pexit, EX_CLOSED) ); /* Grabbing Exit Value -- Cynshard */
spaces = 6 - strlen (dir_name[pexit->vdir]); /* Initializing Spaces for Output -- Cynshard */
if (spaces to_room )
{
found = TRUE;
if ( fAuto )
{
/* Removing initial space -- Cynshard
mudstrlcat( buf, " ", MSL );
*/
if( MXP_ON( ch ) )
mudstrlcat( buf, "", MSL );
/* Formatting Immortal AutoExits to look like the exits arg -- Cynshard */
mudstrlcat( buf, capitalize( dir_name[pexit->vdir] ), MSL );
for( int i = 1; i to_room->name, MSL );
/* End Immortal AutoExits Format */
if( MXP_ON( ch ) )
mudstrlcat( buf, "", MSL );
if ( IS_EXIT_FLAG(pexit, EX_OVERLAND) )
mudstrlcat( buf, "->(Overland)", MSL );
/* New code added to display closed, or otherwise invisible exits to immortals */
/* Installed by Samson 1-25-98 */
if ( IS_EXIT_FLAG(pexit, EX_CLOSED) )
mudstrlcat( buf, "->(Closed)", MSL );
if ( IS_EXIT_FLAG(pexit, EX_WINDOW) )
mudstrlcat( buf, "->(Window)", MSL );
if ( IS_EXIT_FLAG(pexit, EX_HIDDEN) )
mudstrlcat( buf, "->(Hidden)", MSL );
if( IS_PCFLAG( ch, PCFLAG_SHOWVNUMS ) )
{
snprintf( exitbuf, 256, " &[iface4]&D", pexit->to_room->vnum ? pexit->to_room->vnum : -1 );
mudstrlcat( buf, exitbuf, MSL );
}
mudstrlcat( buf, "\r\n", MSL ); /* Puts Each Exit on a New Line */
} /* END IMMORTAL AUTOLOOK -- Cynshard */
else /* Begin Immortal Argument Look -- Cynshard */
{
snprintf( buf + strlen(buf), MSL - strlen(buf), "%s%*s - %s", capitalize( dir_name[pexit->vdir] ), spaces," ", pexit->to_room->name ); /* Changed to Format Exits -- Cynshard*/
/* More new code added to display closed, or otherwise invisible exits to immortals */
/* Installed by Samson 1-25-98 */
if( room_is_dark( pexit->to_room, ch ) )
mudstrlcat( buf, "->(Dark)", MSL );
if( IS_EXIT_FLAG( pexit, EX_CLOSED ) )
mudstrlcat( buf, "->(Closed)", MSL );
if( IS_EXIT_FLAG( pexit, EX_HIDDEN ) )
mudstrlcat( buf, "->(Hidden)", MSL );
if( IS_EXIT_FLAG( pexit, EX_WINDOW ) )
mudstrlcat( buf, "->(Window)", MSL );
if( IS_PCFLAG( ch, PCFLAG_SHOWVNUMS ) )
{
snprintf( exitbuf, 256, " &[iface4]&D", pexit->to_room->vnum ? pexit->to_room->vnum : -1 );
mudstrlcat( buf, exitbuf, MSL );
}
mudstrlcat( buf, "\r\n", MSL );
} /* End Immortal Arg exits -- Cynshard */
} /* End pexit->to_room */
} /* End Immortal Specific Exits -- Cynshard */
else
{
if ( pexit->to_room
&& !IS_EXIT_FLAG(pexit, EX_SECRET)
&& (!IS_EXIT_FLAG(pexit, EX_WINDOW) || IS_EXIT_FLAG(pexit, EX_ISDOOR))
&& !IS_EXIT_FLAG(pexit, EX_HIDDEN)
&& !IS_EXIT_FLAG(pexit, EX_FORTIFIED) /* Checks for walls, Marcus */
&& !IS_EXIT_FLAG(pexit, EX_HEAVY)
&& !IS_EXIT_FLAG(pexit, EX_MEDIUM)
&& !IS_EXIT_FLAG(pexit, EX_LIGHT)
&& !IS_EXIT_FLAG(pexit, EX_CRUMBLING) )
{
found = TRUE;
if ( fAuto ) /* Begin Mortal AutoExits */
{
/*
mudstrlcat( buf, " ", MSL );
*/
if( MXP_ON( ch ) )
mudstrlcat( buf, "", MSL );
/* Formatting mortal AutoExits to look like the exits arg -- Cynshard */
mudstrlcat( buf, capitalize( dir_name[pexit->vdir] ), MSL );
for( int i = 1; i to_room->name, MSL );
else if(eClosed)
mudstrlcat( buf, "Closed", MSL );
/* End mortal AutoExits Format */
if( MXP_ON( ch ) )
mudstrlcat( buf, "", MSL );
/*
if ( IS_EXIT_FLAG(pexit, EX_CLOSED) )
mudstrlcat( buf, "->(Closed)", MSL );
*/
/* New Line ! -- Cynshard*/
mudstrlcat( buf, "\r\n", MSL );
}
else
{
if(!eClosed)
snprintf( buf + strlen(buf), MSL - strlen(buf), "%s%*s - %s\r\n", capitalize( dir_name[pexit->vdir] ), spaces," ", room_is_dark( pexit->to_room, ch ) ? "Too dark to tell" : pexit->to_room->name ); /* Changed to Format Exits -- Cynshard*/
else if(eClosed)
snprintf( buf + strlen(buf), MSL - strlen(buf), "%s%*s - %s\r\n", capitalize( dir_name[pexit->vdir] ), spaces," ", "Closed"
; /* Changed to Format Exits -- Cynshard*/
/*
snprintf( buf + strlen(buf), MSL - strlen(buf), "%s - %s\r\n", capitalize( dir_name[pexit->vdir] ),
room_is_dark( pexit->to_room, ch ) ? "Too dark to tell" : pexit->to_room->name );
*/
}
}
}
}
if ( !found )
{
mudstrlcat( buf, fAuto ? "none.\r\n" : "None.\r\n", MSL ); /* Changed -- Cynshard */
if( MXP_ON( ch ) )
mudstrlcat( buf, MXP_TAG_ROOMEXIT_CLOSE, MSL );
}
else
{
if ( fAuto )
{
mudstrlcat( buf, "", MSL ); /* Changed -- Jesse */
if( MXP_ON( ch ) )
mudstrlcat( buf, MXP_TAG_ROOMEXIT_CLOSE, MSL );
}
}
/* Remove the Extra Spaces
mudstrlcat( buf, "\r\n", MSL );
*/
send_to_char( buf, ch );
return;
}