mirror of
https://github.com/tbamud/tbamud.git
synced 2026-03-27 14:46:33 +01:00
Increase vnum capabilities
This commit is contained in:
parent
6d17d8d77a
commit
0ebf1cb02f
25 changed files with 231 additions and 51 deletions
|
|
@ -5797,7 +5797,7 @@ ACMD(do_msave)
|
|||
o = GET_EQ(vict, pos);
|
||||
if (!o) continue;
|
||||
if (GET_OBJ_VNUM(o) <= 0) continue;
|
||||
loadout_add_entry(&mob_proto[rnum].proto_loadout, GET_OBJ_VNUM(o), (sh_int)pos, 1);
|
||||
loadout_add_entry(&mob_proto[rnum].proto_loadout, GET_OBJ_VNUM(o), (int)pos, 1);
|
||||
equips_added++;
|
||||
}
|
||||
|
||||
|
|
|
|||
12
src/db.c
12
src/db.c
|
|
@ -1864,7 +1864,7 @@ void parse_mobile(FILE *mob_f, int nr)
|
|||
log("SYSERR: Bad 'L' line in mob #%d: '%s' (need <wear_pos> <obj_vnum> [qty]).", nr, line);
|
||||
} else {
|
||||
if (qty < 1) qty = 1;
|
||||
loadout_add_entry(&mob_proto[i].proto_loadout, vnum, (sh_int)wpos, qty);
|
||||
loadout_add_entry(&mob_proto[i].proto_loadout, vnum, (int)wpos, qty);
|
||||
}
|
||||
/* look ahead to see if there is another 'L' */
|
||||
letter = fread_letter(mob_f);
|
||||
|
|
@ -1892,7 +1892,7 @@ void parse_mobile(FILE *mob_f, int nr)
|
|||
log("SYSERR: Bad post-trigger 'L' line in mob #%d: '%s' (need <wear_pos> <obj_vnum> [qty]).", nr, line);
|
||||
} else {
|
||||
if (qty < 1) qty = 1;
|
||||
loadout_add_entry(&mob_proto[i].proto_loadout, vnum, (sh_int)wpos, qty);
|
||||
loadout_add_entry(&mob_proto[i].proto_loadout, vnum, (int)wpos, qty);
|
||||
}
|
||||
letter = fread_letter(mob_f);
|
||||
}
|
||||
|
|
@ -2145,7 +2145,7 @@ static void load_zones(FILE *fl, char *zonename)
|
|||
|
||||
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);
|
||||
}
|
||||
|
|
@ -2168,15 +2168,15 @@ static void load_zones(FILE *fl, char *zonename)
|
|||
|
||||
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 {
|
||||
|
|
|
|||
|
|
@ -1068,7 +1068,7 @@ ACMD(do_mdoor)
|
|||
strcat(newexit->general_description, "\r\n");
|
||||
break;
|
||||
case 2: /* flags */
|
||||
newexit->exit_info = (sh_int)asciiflag_conv(value);
|
||||
newexit->exit_info = (int)asciiflag_conv(value);
|
||||
break;
|
||||
case 3: /* key */
|
||||
newexit->key = atoi(value);
|
||||
|
|
|
|||
|
|
@ -668,7 +668,7 @@ static OCMD(do_odoor)
|
|||
strcat(newexit->general_description, "\r\n"); /* strcat : OK */
|
||||
break;
|
||||
case 2: /* flags */
|
||||
newexit->exit_info = (sh_int)asciiflag_conv(value);
|
||||
newexit->exit_info = (int)asciiflag_conv(value);
|
||||
break;
|
||||
case 3: /* key */
|
||||
newexit->key = atoi(value);
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ WCMD(do_wdoor)
|
|||
strcat(newexit->general_description, "\r\n");
|
||||
break;
|
||||
case 2: /* flags */
|
||||
newexit->exit_info = (sh_int)asciiflag_conv(value);
|
||||
newexit->exit_info = (int)asciiflag_conv(value);
|
||||
break;
|
||||
case 3: /* key */
|
||||
newexit->key = atoi(value);
|
||||
|
|
|
|||
|
|
@ -1302,7 +1302,7 @@ void boot_the_shops(FILE *shop_f, char *filename, int rec_count)
|
|||
shop_index[top_shop].message_sell = read_shop_message(6, SHOP_NUM(top_shop), shop_f, buf2);
|
||||
read_line(shop_f, "%d", &SHOP_BROKE_TEMPER(top_shop));
|
||||
read_line(shop_f, "%ld", &SHOP_BITVECTOR(top_shop));
|
||||
read_line(shop_f, "%hd", &SHOP_KEEPER(top_shop));
|
||||
read_line(shop_f, "%d", &SHOP_KEEPER(top_shop));
|
||||
|
||||
SHOP_KEEPER(top_shop) = real_mobile(SHOP_KEEPER(top_shop));
|
||||
read_line(shop_f, "%d", &SHOP_TRADE_WITH(top_shop));
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
* signed anymore so use the unsigned types and get 65,535 objects instead of
|
||||
* 32,768. NOTE: This will likely be unconditionally unsigned later.
|
||||
* 0 = use signed indexes; 1 = use unsigned indexes */
|
||||
#define CIRCLE_UNSIGNED_INDEX 1
|
||||
#define CIRCLE_UNSIGNED_INDEX 0
|
||||
|
||||
#if CIRCLE_UNSIGNED_INDEX
|
||||
# define IDXTYPE ush_int /**< Index types are unsigned short ints */
|
||||
|
|
@ -38,9 +38,9 @@
|
|||
# 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 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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue