mud.h
int room_flags;
becomes
EXT_BV room_flags;
#define IS_OUTSIDE(ch) (!IS_SET( \
(ch)->in_room->room_flags, \
ROOM_INDOORS) && !IS_SET( \
(ch)->in_room->room_flags, \
ROOM_TUNNEL))
becomes
#define IS_OUTSIDE(ch) (!xIS_SET( \
(ch)->in_room->room_flags, \
ROOM_INDOORS) && !xIS_SET( \
(ch)->in_room->room_flags, \
ROOM_TUNNEL))
All of the room flag defines change:
#define ROOM_DARK BV00
becomes:
#define ROOM_DARK 0
And so forth, removing the BV prefix, and any unneccessary 0's
Optionally you can convert them into an enumerated list:
typedef enum
{
ROOM_DARK, ROOM_DEATH, ROOM_NO_MOB, ROOM_INDOORS, ROOM_LAWFUL,
ROOM_NEUTRAL, ROOM_CHAOTIC, ROOM_NO_MAGIC, ROOM_TUNNEL,
ROOM_PRIVATE, ROOM_SAFE, ROOM_SOLITARY, ROOM_PET_SHOP,
ROOM_NO_RECALL, ROOM_DONATION, ROOM_NODROPALL,
ROOM_SILENCE, ROOM_LOGSPEECH, ROOM_NODROP, ROOM_CLANSTOREROOM,
ROOM_NO_SUMMON, ROOM_NO_ASTRAL, ROOM_TELEPORT, ROOM_TELESHOWDESC,
ROOM_NOFLOOR, ROOM_NOSUPPLICATE, ROOM_ARENA, ROOM_NOMISSILE,
ROOM_PROTOTYPE, ROOM_DND
} roomflags;
which looks prettier and is less typing
Change all references (in the entire mud or you wont compile) of SET_BIT for room_flags to xSET_BIT
Change all references (in the entire mud or you wont compile) of REMOVE_BIT for room_flags to xREMOVE_BIT
Change all references (in the entire mud or you wont compile) of TOGGLE_BIT for room_flags to xTOGGLE_BIT
Change all references (in the entire mud or you wont compile) of REMOVE_BIT for room_flags to xREMOVE_BIT
Change all references (in the entire mud or you wont compile) of flag_string( for room_flags to ext_flag_string( &
act_wiz.c
ch_printf_color( ch, "&cRoom flags: &w%s\n\r",
flag_string(location->room_flags, r_flags) );
becomes:
ch_printf_color( ch, "&cRoom flags: &w%s\n\r",
ext_flag_string(&location->room_flags, r_flags) );
build.c
fprintf( fpout, "0 %d %d %d %d %d\n", room->room_flags,
room->sector_type,
room->tele_delay,
room->tele_vnum,
room->tunnel );
becomes:
fprintf( fpout, "0 %s %d %d %d %d\n", print_bitvector(&room->room_flags),
room->sector_type,
room->tele_delay,
room->tele_vnum,
room->tunnel );
fprintf( fpout, "0 %d %d\n", room->room_flags,
room->sector_type );
becomes:
fprintf( fpout, "0 %s %d\n", print_bitvector(&room->room_flags),
room->sector_type );
location->room_flags = value;
becomes:
location->room_flags = meb(value);
while ( argument[0] != '\0' )
{
argument = one_argument( argument, arg2 );
value = get_rflag( arg2 );
if ( value < 0 || value > 31 )
ch_printf( ch, "Unknown flag: %s\n\r", arg2 );
else
{
if ( 1 << value == ROOM_PROTOTYPE
&& get_trust( ch ) < LEVEL_GREATER )
send_to_char( "You cannot change the prototype flag.\n\r", ch );
else
TOGGLE_BIT( location->room_flags, 1 << value );
}
}
becomes:
while ( argument[0] != '\0' )
{
argument = one_argument( argument, arg2 );
value = get_rflag( arg2 );
if ( value < 0 || value > MAX_BITS )
ch_printf( ch, "Unknown flag: %s\n\r", arg2 );
else
{
if ( value == ROOM_PROTOTYPE
&& get_trust( ch ) < LEVEL_GREATER )
send_to_char( "You cannot change the prototype flag.\n\r", ch );
else
xTOGGLE_BIT( location->room_flags, value );
}
}
comm.c
if ( IS_IMMORTAL( och ) )
sprintf( pbuf, "%s", flag_string( ch->in_room->room_flags, r_flags) );
becomes:
if ( IS_IMMORTAL( och ) )
sprintf( pbuf, "%s", ext_flag_string( &ch->in_room->room_flags, r_flags) );
db.c
pRoomIndex->room_flags = ROOM_PROTOTYPE;
becomes
pRoomIndex->room_flags = meb(ROOM_PROTOTYPE);
handler.c
room->room_flags = 0;
becomes
xCLEAR_BITS(room->room_flags);
mapout.c
location -> room_flags = ROOM_PROTOTYPE && rm -> room_flags;
becomes
xCLEAR_BITS(location->room_flags);
xSET_BITS(location->room_flags, rm->room_flags);
xSET_BIT(location->room_flags, ROOM_PROTOTYPE);
track.c
#define MARK(room) (SET_BIT( (room)->room_flags, BFS_MARK) )
#define UNMARK(room) (REMOVE_BIT( (room)->room_flags, BFS_MARK) )
#define IS_MARKED(room) (IS_SET( (room)->room_flags, BFS_MARK) )
becomes
#define MARK(room) (xSET_BIT( (room)->room_flags, BFS_MARK) )
#define UNMARK(room) (xREMOVE_BIT( (room)->room_flags, BFS_MARK) )
#define IS_MARKED(room) (xIS_SET( (room)->room_flags, BFS_MARK) )
db.c
/* Area number fread_number( fp ); */
ln = fread_line( fp );
x1=x2=x3=x4=x5=x6=0;
sscanf( ln, "%d %d %d %d %d %d",
&x1, &x2, &x3, &x4, &x5, &x6 );
pRoomIndex->room_flags = x2;
pRoomIndex->sector_type = x3;
pRoomIndex->tele_delay = x4;
pRoomIndex->tele_vnum = x5;
pRoomIndex->tunnel = x6;
becomes:
x1=x2=x3=x4=x5=x6=0;
fread_number( fp );
pRoomIndex->room_flags = fread_bitvector( fp );
ln = fread_line( fp );
sscanf( ln, "%d %d %d %d", &x3, &x4, &x5, &x6 );
pRoomIndex->sector_type = x3;
pRoomIndex->tele_delay = x4;
pRoomIndex->tele_vnum = x5;
pRoomIndex->tunnel = x6;
Done.
Now
make clean
make smaug
And reboot/copyover for the changes to take effect.