Here's what you need to do..
First open build.c..
add your second array:
char * const r_flags2 [] =
{
"r00", "r01", "r02", "r03", "r04", "r05",
"r06", "r07", "r08", "r09", "r10", "r11",
"r12", "r13", "r14", "r15", "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
"r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31"
};
further down.. below get_rflag..
add this:
int get_rflag2( char *flag )
{
int x;
for ( x = 0; x < 32; x++ )
if ( !str_cmp( flag, r_flags2[x] ) )
return x;
return -1;
}
then in do_redit()
add this below the.. if ( !str_cmp( arg, "flags" ) ) section
if ( !str_cmp( arg, "flags2" ) )
{
if ( !argument || argument[0] == '\0' )
{
send_to_char( "Toggle the room flags.\n\r", ch );
send_to_char( "Usage: redit flags <flag> [flag]...\n\r", ch );
send_to_char( "\n\rPossible Flags: \n\r", ch );
send_to_char( "blah blah blah\n\r", ch );
return;
}
while ( argument[0] != '\0' )
{
argument = one_argument( argument, arg2 );
value = get_rflag2( arg2 );
if ( value < 0 || value > 31 )
ch_printf( ch, "Unknown flag: %s\n\r", arg2 );
TOGGLE_BIT( location->room_flags2, 1 << value );
}
return;
}
then open act_wiz.c
and in do_rstat()
below..
ch_printf( ch, "&GRoom flags: &W%s\n\r",
flag_string(location->room_flags, r_flags) );
add..
ch_printf( ch, "&GRoom flags2: &W%s\n\r",
flag_string(location->room_flags2, r_flags2) );
then open up mud.h
and add this to room_index_data..
int room_flags2;
Now all you have to do is add a second set of defines..
For example:
...
#define ROOM_PROTOTYPE BV30
#define ROOM_AUCTION BV31
/* Second Set of Room Flags */
#define ROOM_FLAG1 BV00
#define ROOM_FLAG2 BV01
Recompile and you're done.. now too add more flags, add them too array r_flags2 instead of r_flags in build.c,
and use 'redit flags2' instead of 'redit flags'
When using the flags in your code.. just use SET_BIT(room->room_flags2, ROOM_FLAG1); instead of room->room_flags
Hope this helps.. I don't actually use this code (i use extended BV's) and I may have forgot something.. but it should work for ya. |