- Posts: 227
- Thank you received: 52
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
welcor wrote: Complete diff from tbamud.com to switch to 2bill room numbers:
Code:Index: db.c =================================================================== --- db.c (revision 217) +++ db.c (working copy) @@ -1072,9 +1072,6 @@ log("SYSERR: Format error after %s #%d", modes[mode], last); exit(1); } - if (nr >= 99999) - return; - else switch (mode) { case DB_BOOT_WLD: parse_room(fl, nr); @@ -2023,7 +2021,7 @@ line_num += get_line(fl, buf); - if (sscanf(buf, "#%hd", &Z.number) != 1) { + if (sscanf(buf, "#%d", &Z.number) != 1) { log("SYSERR: Format error in %s, line %d", zname, line_num); exit(1); } @@ -2045,15 +2043,15 @@ line_num += get_line(fl, buf); /* Look for 10 items first (new tbaMUD), if not found, try 4 (old tbaMUD) */ - if (sscanf(buf, " %hd %hd %d %d %s %s %s %s %d %d", &Z.bot, &Z.top, &Z.lifespan, + if (sscanf(buf, " %d %d %d %d %s %s %s %s %d %d", &Z.bot, &Z.top, &Z.lifespan, &Z.reset_mode, zbuf1, zbuf2, zbuf3, zbuf4, &Z.min_level, &Z.max_level) != 10) { - if (sscanf(buf, " %hd %hd %d %d ", &Z.bot, &Z.top, &Z.lifespan, &Z.reset_mode) != 4) { + if (sscanf(buf, " %d %d %d %d ", &Z.bot, &Z.top, &Z.lifespan, &Z.reset_mode) != 4) { /* This may be due to the fact that the zone has no builder. So, we just * attempt to fix this by copying the previous 2 last reads into this * variable and the last one. */ log("SYSERR: Format error in numeric constant line of %s, attempting to fix.", zname); - if (sscanf(Z.name, " %hd %hd %d %d ", &Z.bot, &Z.top, &Z.lifespan, &Z.reset_mode) != 4) { + if (sscanf(Z.name, " %d %d %d %d ", &Z.bot, &Z.top, &Z.lifespan, &Z.reset_mode) != 4) { log("SYSERR: Could not fix previous error, aborting game."); exit(1); } else { @@ -3297,7 +3295,7 @@ obj->item_number = NOTHING; IN_ROOM(obj) = NOWHERE; - obj->worn_on = NOWHERE; + obj->worn_on = -1; } /* Called during character creation after picking character class (and then Index: structs.h =================================================================== --- structs.h (revision 217) +++ structs.h (working copy) @@ -35,17 +35,17 @@ #define CIRCLE_UNSIGNED_INDEX 1 #if CIRCLE_UNSIGNED_INDEX -# define IDXTYPE ush_int /** Index types are unsigned short ints */ -# define IDXTYPE_MAX USHRT_MAX /** Used for compatibility checks. */ +# define IDXTYPE unsigned int /** Index types are unsigned short ints */ +# define IDXTYPE_MAX UINT_MAX /** Used for compatibility checks. */ # define IDXTYPE_MIN 0 /** Used for compatibility checks. */ # define NOWHERE ((IDXTYPE)~0) /** Sets to ush_int_MAX, or 65,535 */ # define NOTHING ((IDXTYPE)~0) /** Sets to ush_int_MAX, or 65,535 */ # define NOBODY ((IDXTYPE)~0) /** Sets to ush_int_MAX, or 65,535 */ # define NOFLAG ((IDXTYPE)~0) /** Sets to ush_int_MAX, or 65,535 */ #else -# define IDXTYPE sh_int /** Index types are unsigned short ints */ -# define IDXTYPE_MAX SHRT_MAX /** Used for compatibility checks. */ -# define IDXTYPE_MIN SHRT_MIN /** Used for compatibility checks. */ +# define IDXTYPE signed int /** Index types are unsigned short ints */ +# define IDXTYPE_MAX INT_MAX /** Used for compatibility checks. */ +# define IDXTYPE_MIN INT_MIN /** Used for compatibility checks. */ # define NOWHERE ((IDXTYPE)-1) /** nil reference for rooms */ # define NOTHING ((IDXTYPE)-1) /** nil reference for objects */ # define NOBODY ((IDXTYPE)-1) /** nil reference for mobiles */ Index: genzon.c =================================================================== --- genzon.c (revision 217) +++ genzon.c (working copy) @@ -51,24 +51,22 @@ { FILE *fp; struct zone_data *zone; - int i, max_zone; + int i, max_zone = IDXTYPE_MAX/100; zone_rnum rznum; char buf[MAX_STRING_LENGTH]; #if CIRCLE_UNSIGNED_INDEX - max_zone = 655; if (vzone_num == NOWHERE) { #else - max_zone = 327; if (vzone_num < 0) { #endif *error = "You can't make negative zones.\r\n"; return NOWHERE; } else if (vzone_num > max_zone) { #if CIRCLE_UNSIGNED_INDEX - *error = "New zone cannot be higher than 655.\r\n"; + *error = "New zone cannot be higher than 42949672.\r\n"; #else - *error = "New zone cannot be higher than 327.\r\n"; + *error = "New zone cannot be higher than 21474836.\r\n"; #endif return NOWHERE; } else if (bottom > top) {
I believe it's the old 99999 sanity check that's causing you trouble.
This fix in db.c is actually a general bugfix:Code:@@ -3297,7 +3295,7 @@ obj->item_number = NOTHING; IN_ROOM(obj) = NOWHERE; - obj->worn_on = NOWHERE; + obj->worn_on = -1; } /* Called during character creation after picking character class (and then
Please Log in or Create an account to join the conversation.
tbaMUD © 2024