diff -BbuprN -x '*.o' /mnt/c/users/plexmud/documents/temp/src/constants.c /mnt/c/users/plexmud/documents/temp/tbamud-2020/src/constants.c --- /mnt/c/users/plexmud/documents/temp/src/constants.c 2020-01-14 13:21:06.000000000 -0600 +++ /mnt/c/users/plexmud/documents/temp/tbamud-2020/src/constants.c 2020-06-11 12:21:15.546613500 -0500 @@ -284,6 +284,18 @@ const char *affected_bits[] = "HIDE", "UNUSED", "CHARM", + "NEW23", + "NEW24", + "NEW25", + "NEW26", + "NEW27", + "NEW28", + "NEW29", + "NEW30", + "NEW31", + "NEW32", + "NEW33", + "NEW34", "\n" }; @@ -958,7 +970,7 @@ const char *ibt_bits[] = { /* Various arrays we count so we can check the world files. These * must be at the bottom of the file so they're pre-declared. */ /** Number of defined room bit descriptions. */ - size_t room_bits_count = sizeof(room_bits) / sizeof(room_bits[0]) - 1, + unsigned int room_bits_count = sizeof(room_bits) / sizeof(room_bits[0]) - 1, /** Number of defined action bit descriptions. */ action_bits_count = sizeof(action_bits) / sizeof(action_bits[0]) - 1, /** Number of defined affected bit descriptions. */ diff -BbuprN -x '*.o' /mnt/c/users/plexmud/documents/temp/src/constants.h /mnt/c/users/plexmud/documents/temp/tbamud-2020/src/constants.h --- /mnt/c/users/plexmud/documents/temp/src/constants.h 2020-01-14 13:21:06.000000000 -0600 +++ /mnt/c/users/plexmud/documents/temp/tbamud-2020/src/constants.h 2020-06-11 12:21:19.849495000 -0500 @@ -53,10 +53,10 @@ extern const char *otrig_types[]; extern const char *wtrig_types[]; extern const char *history_types[]; extern const char *ibt_bits[]; -extern size_t room_bits_count; -extern size_t action_bits_count; -extern size_t affected_bits_count; -extern size_t extra_bits_count; -extern size_t wear_bits_count; +extern unsigned int room_bits_count; +extern unsigned int action_bits_count; +extern unsigned int affected_bits_count; +extern unsigned int extra_bits_count; +extern unsigned int wear_bits_count; #endif /* _CONSTANTS_H_ */ diff -BbuprN -x '*.o' /mnt/c/users/plexmud/documents/temp/src/db.c /mnt/c/users/plexmud/documents/temp/tbamud-2020/src/db.c --- /mnt/c/users/plexmud/documents/temp/src/db.c 2020-01-14 13:21:06.000000000 -0600 +++ /mnt/c/users/plexmud/documents/temp/tbamud-2020/src/db.c 2020-06-11 13:36:33.890961700 -0500 @@ -127,7 +127,7 @@ struct happyhour happy_data = {0,0,0,0}; static int converting = FALSE; /* Local (file scope) utility functions */ -static int check_bitvector_names(bitvector_t bits, size_t namecount, const char *whatami, const char *whatbits); +static int check_bitvector_names(int arraryelement, unsigned int bits, int namecount, const char *whatami, const char *whatbits); static int check_object_spell_number(struct obj_data *obj, int val); static int check_object_level(struct obj_data *obj, int val); static int check_object(struct obj_data *); @@ -1285,7 +1285,7 @@ void parse_room(FILE *fl, int virtual_nr sprintf(flags, "room #%d", virtual_nr); /* sprintf: OK (until 399-bit integers) */ /* No need to scan the other three sections; they're 0 anyway. */ - check_bitvector_names(world[room_nr].room_flags[0], room_bits_count, flags, "room"); + check_bitvector_names(0, world[room_nr].room_flags[0], room_bits_count, flags, "room"); if(bitsavetodisk) { /* Maybe the implementor just wants to look at the 128bit files */ add_to_save_list(zone_table[real_zone_by_thing(virtual_nr)].number, 3); @@ -1303,7 +1303,7 @@ void parse_room(FILE *fl, int virtual_nr sprintf(flags, "object #%d", virtual_nr); /* sprintf: OK (until 399-bit integers) */ for(taeller=0; taeller < AF_ARRAY_MAX; taeller++) - check_bitvector_names(world[room_nr].room_flags[taeller], room_bits_count, flags, "room"); + check_bitvector_names(taeller, world[room_nr].room_flags[taeller], room_bits_count, flags, "room"); /* Added Sanity check */ if (t[2] > NUM_ROOM_SECTORS) t[2] = SECT_INSIDE; @@ -1770,7 +1770,7 @@ void parse_mobile(FILE *mob_f, int nr) MOB_FLAGS(mob_proto + i)[1] = 0; MOB_FLAGS(mob_proto + i)[2] = 0; MOB_FLAGS(mob_proto + i)[3] = 0; - check_bitvector_names(MOB_FLAGS(mob_proto + i)[0], action_bits_count, buf2, "mobile"); + check_bitvector_names(0, MOB_FLAGS(mob_proto + i)[0], action_bits_count, buf2, "mobile"); AFF_FLAGS(mob_proto + i)[0] = asciiflag_conv_aff(f2); AFF_FLAGS(mob_proto + i)[1] = 0; @@ -1790,7 +1790,7 @@ void parse_mobile(FILE *mob_f, int nr) if (MOB_FLAGGED(mob_proto + i, MOB_AGGRESSIVE) && MOB_FLAGGED(mob_proto + i, MOB_AGGR_EVIL)) REMOVE_BIT_AR(MOB_FLAGS(mob_proto + i), MOB_AGGR_EVIL); - check_bitvector_names(AFF_FLAGS(mob_proto + i)[0], affected_bits_count, buf2, "mobile affect"); + check_bitvector_names(0, AFF_FLAGS(mob_proto + i)[0], affected_bits_count, buf2, "mobile affect"); /* This is necessary, since if we have conventional world files, &letter is * loaded into f4 instead of the letter characters. So what we do, is copy @@ -1812,7 +1812,7 @@ void parse_mobile(FILE *mob_f, int nr) MOB_FLAGS(mob_proto + i)[2] = asciiflag_conv(f3); MOB_FLAGS(mob_proto + i)[3] = asciiflag_conv(f4); for(taeller=0; taeller < AF_ARRAY_MAX; taeller++) - check_bitvector_names(MOB_FLAGS(mob_proto + i)[taeller], action_bits_count, buf2, "mobile"); + check_bitvector_names(taeller, MOB_FLAGS(mob_proto + i)[taeller], action_bits_count, buf2, "mobile"); AFF_FLAGS(mob_proto + i)[0] = asciiflag_conv(f5); AFF_FLAGS(mob_proto + i)[1] = asciiflag_conv(f6); @@ -1822,7 +1822,7 @@ void parse_mobile(FILE *mob_f, int nr) GET_ALIGNMENT(mob_proto + i) = t[2]; for(taeller=0; taeller < AF_ARRAY_MAX; taeller++) - check_bitvector_names(AFF_FLAGS(mob_proto + i)[taeller], affected_bits_count, buf2, "mobile affect"); + check_bitvector_names(taeller, AFF_FLAGS(mob_proto + i)[taeller], affected_bits_count, buf2, "mobile affect"); } else { log("SYSERR: Format error after string section of mob #%d\n ...expecting line of form '# # # {S | E}'", nr); exit(1); @@ -3687,9 +3687,9 @@ static int check_object(struct obj_data snprintf(objname, sizeof(objname), "Object #%d (%s)", GET_OBJ_VNUM(obj), obj->short_description); for(y = 0; y < TW_ARRAY_MAX; y++) { - error |= check_bitvector_names(GET_OBJ_WEAR(obj)[y], wear_bits_count, objname, "object wear"); - error |= check_bitvector_names(GET_OBJ_EXTRA(obj)[y], extra_bits_count, objname, "object extra"); - error |= check_bitvector_names(GET_OBJ_AFFECT(obj)[y], affected_bits_count, objname, "object affect"); + error |= check_bitvector_names(y, GET_OBJ_WEAR(obj)[y], wear_bits_count, objname, "object wear"); + error |= check_bitvector_names(y, GET_OBJ_EXTRA(obj)[y], extra_bits_count, objname, "object extra"); + error |= check_bitvector_names(y, GET_OBJ_AFFECT(obj)[y], affected_bits_count, objname, "object affect"); } switch (GET_OBJ_TYPE(obj)) { @@ -3795,22 +3795,33 @@ static int check_object_level(struct obj return (error); } -static int check_bitvector_names(bitvector_t bits, size_t namecount, const char *whatami, const char *whatbits) +static int check_bitvector_names(int arraryelement, unsigned int bits, int namecount, const char *whatami, const char *whatbits) { unsigned int flagnum; bool error = FALSE; + int maxbit_element; + int startflag; - /* See if any bits are set above the ones we know about. */ - if (bits <= (~(bitvector_t)0 >> (sizeof(bitvector_t) * 8 - namecount))) - return (FALSE); +// determine which element the max bit is in +maxbit_element = (namecount / 32); - for (flagnum = namecount; flagnum < sizeof(bitvector_t) * 8; flagnum++) +// start looking at bits > the max bit. +if (arraryelement == maxbit_element) + startflag = namecount - (32 * maxbit_element); +else + startflag = 0; + +// only look at bits in elements that contain the max bit or greater +if (arraryelement >= maxbit_element) { + for (flagnum = startflag; flagnum < 32; flagnum++) { if ((1 << flagnum) & bits) { - log("SYSERR: %s has unknown %s flag, bit %d (0 through %d known).", whatami, whatbits, flagnum, (int)namecount - 1); + log("SYSERR: %s has unknown %s flag, bit %d in element %d (0 through %d known).", whatami, whatbits, flagnum, arraryelement, namecount - 1); error = TRUE; } - - return (error); + } +} +return (error); } static void load_default_config( void ) diff -BbuprN -x '*.o' /mnt/c/users/plexmud/documents/temp/src/structs.h /mnt/c/users/plexmud/documents/temp/tbamud-2020/src/structs.h --- /mnt/c/users/plexmud/documents/temp/src/structs.h 2020-01-14 13:21:06.000000000 -0600 +++ /mnt/c/users/plexmud/documents/temp/tbamud-2020/src/structs.h 2020-06-09 14:57:58.026178500 -0500 @@ -291,8 +291,21 @@ #define AFF_HIDE 20 /**< Char is hidden */ #define AFF_FREE 21 /**< Room for future expansion */ #define AFF_CHARM 22 /**< Char is charmed */ +#define AFF_NEW23 23 +#define AFF_NEW24 24 +#define AFF_NEW25 25 +#define AFF_NEW26 26 +#define AFF_NEW27 27 +#define AFF_NEW28 28 +#define AFF_NEW29 29 +#define AFF_NEW30 30 +#define AFF_NEW31 31 +#define AFF_NEW32 32 +#define AFF_NEW33 33 +#define AFF_NEW34 34 + /** Total number of affect flags not including the don't use flag. */ -#define NUM_AFF_FLAGS 22 +#define NUM_AFF_FLAGS 35 /* Modes of connectedness: used by descriptor_data.state */ #define CON_PLAYING 0 /**< Playing - Nominal state */