Welcome to the Builder Academy

Question Out of Curiosity

More
16 Aug 2012 00:33 #687 by Vatiken
Replied by Vatiken on topic Re: Out of Curiosity
Something didn't load right, make sure all your index types are set right in struct.h.

tbaMUD developer/programmer

Please Log in or Create an account to join the conversation.

More
16 Aug 2012 00:40 #688 by Gahan
Replied by Gahan on topic Re: Out of Curiosity
I hate to Hijack a thread, but everything is set properly..

#define CIRCLE_UNSIGNED_INDEX 1

#if CIRCLE_UNSIGNED_INDEX
# define IDXTYPE unsigned int
# define IDXTYPE_MAX UINT_MAX
# define IDXTYPE_MIN 0
# define NOWHERE ((IDXTYPE)~0)
# define NOTHING ((IDXTYPE)~0)
# define NOBODY ((IDXTYPE)~0)
# define NOFLAG ((IDXTYPE)~0)

Please Log in or Create an account to join the conversation.

More
16 Aug 2012 04:22 #689 by zusuk
Replied by zusuk on topic Re: Out of Curiosity
It isn't hi-jacking :P I pinned this thread because in my not too far future I plan on doing the same thing...

Let me know how you solve the issue :)

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100

Please Log in or Create an account to join the conversation.

More
11 Jan 2013 02:23 - 11 Jan 2013 02:24 #1268 by Nerian
Replied by Nerian on topic Re: Out of Curiosity
I got the 2 billion snippet to work on Gicker's D20 using the following from TBAmud

here is the website
cwg.lazuras.org/modules.php?name=Forums&...ight=billion&start=0

and here is the code quote

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







I hope this helps somebody!
Last edit: 11 Jan 2013 02:24 by Nerian.
The following user(s) said Thank You: zusuk

Please Log in or Create an account to join the conversation.

Time to create page: 0.469 seconds