mirror of
https://github.com/tbamud/tbamud.git
synced 2025-12-22 18:20:13 +01:00
Added diagonal directions, hidden exits flag and bug fixes
This commit is contained in:
parent
7531e92f64
commit
5acbfd29eb
33 changed files with 378 additions and 130 deletions
|
|
@ -35,6 +35,11 @@ export (QQ's a zone into a tarball)
|
||||||
Xlist (mlist, olist, rlist, zlist, slist, tlist, qlist)
|
Xlist (mlist, olist, rlist, zlist, slist, tlist, qlist)
|
||||||
(lots of major bugfixes too)
|
(lots of major bugfixes too)
|
||||||
@
|
@
|
||||||
|
[Nov 25 2010] - Jamdog
|
||||||
|
Added diagonal directions with cedit toggle (default to 'off')
|
||||||
|
Bug-Fix: admin <player> default now targets the victim player
|
||||||
|
Bug-Fix: Crash bug developed due to no 'vict' in is_tell_ok, added checks
|
||||||
|
Added HIDDEN flag for doors, hiding from exits, autoexits, scan and map
|
||||||
[Nov 24 2010] - Jamdog
|
[Nov 24 2010] - Jamdog
|
||||||
Split mortal and admin levels (thanks fnord for original patch/idea)
|
Split mortal and admin levels (thanks fnord for original patch/idea)
|
||||||
Mortal level converted to ubyte for 255 max
|
Mortal level converted to ubyte for 255 max
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,11 @@ static void perform_tell(struct char_data *ch, struct char_data *vict, char *arg
|
||||||
|
|
||||||
static int is_tell_ok(struct char_data *ch, struct char_data *vict)
|
static int is_tell_ok(struct char_data *ch, struct char_data *vict)
|
||||||
{
|
{
|
||||||
if (ch == vict)
|
if (!ch)
|
||||||
|
log("SYSERR: is_tell_ok called with no characters");
|
||||||
|
else if (!vict)
|
||||||
|
send_to_char(ch, "%s", CONFIG_NOPERSON);
|
||||||
|
else if (ch == vict)
|
||||||
send_to_char(ch, "You try to tell yourself something.\r\n");
|
send_to_char(ch, "You try to tell yourself something.\r\n");
|
||||||
else if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOTELL))
|
else if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_NOTELL))
|
||||||
send_to_char(ch, "You can't tell other people while you have notell on.\r\n");
|
send_to_char(ch, "You can't tell other people while you have notell on.\r\n");
|
||||||
|
|
|
||||||
|
|
@ -408,15 +408,20 @@ static void do_auto_exits(struct char_data *ch)
|
||||||
|
|
||||||
send_to_char(ch, "%s[ Exits: ", CCCYN(ch, C_NRM));
|
send_to_char(ch, "%s[ Exits: ", CCCYN(ch, C_NRM));
|
||||||
|
|
||||||
for (door = 0; door < NUM_OF_DIRS; door++) {
|
for (door = 0; door < DIR_COUNT; door++) {
|
||||||
if (!EXIT(ch, door) || EXIT(ch, door)->to_room == NOWHERE)
|
if (!EXIT(ch, door) || EXIT(ch, door)->to_room == NOWHERE)
|
||||||
continue;
|
continue;
|
||||||
if (EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED) && !CONFIG_DISP_CLOSED_DOORS)
|
if (EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED) && !CONFIG_DISP_CLOSED_DOORS)
|
||||||
continue;
|
continue;
|
||||||
|
if (EXIT_FLAGGED(EXIT(ch, door), EX_HIDDEN) && !ADM_FLAGGED(ch, ADM_SEESECRET))
|
||||||
|
continue;
|
||||||
|
|
||||||
if (EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED))
|
if (EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED))
|
||||||
send_to_char(ch, "%s(%c)%s ", CCRED(ch, C_NRM), LOWER(*dirs[door]), CCCYN(ch, C_NRM));
|
send_to_char(ch, "%s(%s)%s ", EXIT_FLAGGED(EXIT(ch, door), EX_HIDDEN) ? CCWHT(ch, C_NRM) : CCRED(ch, C_NRM), autoexits[door], CCCYN(ch, C_NRM));
|
||||||
|
else if (EXIT_FLAGGED(EXIT(ch, door), EX_HIDDEN))
|
||||||
|
send_to_char(ch, "%s%s%s ", CCWHT(ch, C_NRM), autoexits[door], CCCYN(ch, C_NRM));
|
||||||
else
|
else
|
||||||
send_to_char(ch, "%c ", LOWER(*dirs[door]));
|
send_to_char(ch, "%s ", autoexits[door]);
|
||||||
slen++;
|
slen++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -434,20 +439,24 @@ ACMD(do_exits)
|
||||||
|
|
||||||
send_to_char(ch, "Obvious exits:\r\n");
|
send_to_char(ch, "Obvious exits:\r\n");
|
||||||
|
|
||||||
for (door = 0; door < NUM_OF_DIRS; door++) {
|
for (door = 0; door < DIR_COUNT; door++) {
|
||||||
if (!EXIT(ch, door) || EXIT(ch, door)->to_room == NOWHERE)
|
if (!EXIT(ch, door) || EXIT(ch, door)->to_room == NOWHERE)
|
||||||
continue;
|
continue;
|
||||||
if (EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED) && !CONFIG_DISP_CLOSED_DOORS)
|
if (EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED) && !CONFIG_DISP_CLOSED_DOORS)
|
||||||
continue;
|
continue;
|
||||||
|
if (EXIT_FLAGGED(EXIT(ch, door), EX_HIDDEN) && !ADM_FLAGGED(ch, ADM_SEESECRET))
|
||||||
|
continue;
|
||||||
|
|
||||||
len++;
|
len++;
|
||||||
|
|
||||||
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_SHOWVNUMS) && !EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED))
|
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_SHOWVNUMS) && !EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED))
|
||||||
send_to_char(ch, "%-5s - [%5d] %s\r\n", dirs[door], GET_ROOM_VNUM(EXIT(ch, door)->to_room), world[EXIT(ch, door)->to_room].name);
|
send_to_char(ch, "%-5s - [%5d]%s %s\r\n", dirs[door], GET_ROOM_VNUM(EXIT(ch, door)->to_room),
|
||||||
|
EXIT_FLAGGED(EXIT(ch, door), EX_HIDDEN) ? " [HIDDEN]" : "", world[EXIT(ch, door)->to_room].name);
|
||||||
else if (CONFIG_DISP_CLOSED_DOORS && EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED)) {
|
else if (CONFIG_DISP_CLOSED_DOORS && EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED)) {
|
||||||
/* But we tell them the door is closed */
|
/* But we tell them the door is closed */
|
||||||
send_to_char(ch, "%-5s - The %s is closed.\r\n", dirs[door],
|
send_to_char(ch, "%-5s - The %s is closed%s\r\n", dirs[door],
|
||||||
(EXIT(ch, door)->keyword)? fname(EXIT(ch, door)->keyword) : "opening" );
|
(EXIT(ch, door)->keyword)? fname(EXIT(ch, door)->keyword) : "opening",
|
||||||
|
EXIT_FLAGGED(EXIT(ch, door), EX_HIDDEN) ? " and hidden." : ".");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
send_to_char(ch, "%-5s - %s\r\n", dirs[door], IS_DARK(EXIT(ch, door)->to_room) &&
|
send_to_char(ch, "%-5s - %s\r\n", dirs[door], IS_DARK(EXIT(ch, door)->to_room) &&
|
||||||
|
|
@ -2673,10 +2682,11 @@ ACMD(do_scan)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (door = 0; door < NUM_OF_DIRS; door++) {
|
for (door = 0; door < DIR_COUNT; door++) {
|
||||||
for (range = 1; range<= maxrange; range++) {
|
for (range = 1; range<= maxrange; range++) {
|
||||||
if (world[scanned_room].dir_option[door] && world[scanned_room].dir_option[door]->to_room != NOWHERE &&
|
if (world[scanned_room].dir_option[door] && world[scanned_room].dir_option[door]->to_room != NOWHERE &&
|
||||||
!IS_SET(world[scanned_room].dir_option[door]->exit_info, EX_CLOSED)) {
|
!IS_SET(world[scanned_room].dir_option[door]->exit_info, EX_CLOSED) &&
|
||||||
|
!IS_SET(world[scanned_room].dir_option[door]->exit_info, EX_HIDDEN)) {
|
||||||
scanned_room = world[scanned_room].dir_option[door]->to_room;
|
scanned_room = world[scanned_room].dir_option[door]->to_room;
|
||||||
if (IS_DARK(scanned_room) && !CAN_SEE_IN_DARK(ch)) {
|
if (IS_DARK(scanned_room) && !CAN_SEE_IN_DARK(ch)) {
|
||||||
if (world[scanned_room].people)
|
if (world[scanned_room].people)
|
||||||
|
|
|
||||||
|
|
@ -342,8 +342,10 @@ int perform_move(struct char_data *ch, int dir, int need_specials_check)
|
||||||
room_rnum was_in;
|
room_rnum was_in;
|
||||||
struct follow_type *k, *next;
|
struct follow_type *k, *next;
|
||||||
|
|
||||||
if (ch == NULL || dir < 0 || dir >= NUM_OF_DIRS || FIGHTING(ch))
|
if (ch == NULL || dir < 0 || dir >= DIR_COUNT || FIGHTING(ch))
|
||||||
return (0);
|
return (0);
|
||||||
|
else if (!CONFIG_DIAGONAL_DIRS && IS_DIAGONAL(dir))
|
||||||
|
send_to_char(ch, "Alas, you cannot go that way...\r\n");
|
||||||
else if ((!EXIT(ch, dir) && !buildwalk(ch, dir)) || EXIT(ch, dir)->to_room == NOWHERE)
|
else if ((!EXIT(ch, dir) && !buildwalk(ch, dir)) || EXIT(ch, dir)->to_room == NOWHERE)
|
||||||
send_to_char(ch, "Alas, you cannot go that way...\r\n");
|
send_to_char(ch, "Alas, you cannot go that way...\r\n");
|
||||||
else if (EXIT_FLAGGED(EXIT(ch, dir), EX_CLOSED) && (!ADM_FLAGGED(ch, ADM_WALKANYWHERE)) ) {
|
else if (EXIT_FLAGGED(EXIT(ch, dir), EX_CLOSED) && (!ADM_FLAGGED(ch, ADM_WALKANYWHERE)) ) {
|
||||||
|
|
@ -383,9 +385,11 @@ static int find_door(struct char_data *ch, const char *type, char *dir, const ch
|
||||||
int door;
|
int door;
|
||||||
|
|
||||||
if (*dir) { /* a direction was specified */
|
if (*dir) { /* a direction was specified */
|
||||||
if ((door = search_block(dir, dirs, FALSE)) == -1) { /* Partial Match */
|
if ((door = search_block(dir, dirs, FALSE)) == -1) { /* Partial Match */
|
||||||
send_to_char(ch, "That's not a direction.\r\n");
|
if ((door = search_block(dir, autoexits, FALSE)) == -1) { /* Check 'short' dirs too */
|
||||||
return (-1);
|
send_to_char(ch, "That's not a direction.\r\n");
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (EXIT(ch, door)) { /* Braces added according to indent. -gg */
|
if (EXIT(ch, door)) { /* Braces added according to indent. -gg */
|
||||||
if (EXIT(ch, door)->keyword) {
|
if (EXIT(ch, door)->keyword) {
|
||||||
|
|
@ -406,7 +410,7 @@ static int find_door(struct char_data *ch, const char *type, char *dir, const ch
|
||||||
send_to_char(ch, "What is it you want to %s?\r\n", cmdname);
|
send_to_char(ch, "What is it you want to %s?\r\n", cmdname);
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
for (door = 0; door < NUM_OF_DIRS; door++)
|
for (door = 0; door < DIR_COUNT; door++)
|
||||||
{
|
{
|
||||||
if (EXIT(ch, door))
|
if (EXIT(ch, door))
|
||||||
{
|
{
|
||||||
|
|
@ -684,7 +688,7 @@ ACMD(do_enter)
|
||||||
|
|
||||||
if (*buf) { /* an argument was supplied, search for door
|
if (*buf) { /* an argument was supplied, search for door
|
||||||
* keyword */
|
* keyword */
|
||||||
for (door = 0; door < NUM_OF_DIRS; door++)
|
for (door = 0; door < DIR_COUNT; door++)
|
||||||
if (EXIT(ch, door))
|
if (EXIT(ch, door))
|
||||||
if (EXIT(ch, door)->keyword)
|
if (EXIT(ch, door)->keyword)
|
||||||
if (!str_cmp(EXIT(ch, door)->keyword, buf)) {
|
if (!str_cmp(EXIT(ch, door)->keyword, buf)) {
|
||||||
|
|
@ -696,7 +700,7 @@ ACMD(do_enter)
|
||||||
send_to_char(ch, "You are already indoors.\r\n");
|
send_to_char(ch, "You are already indoors.\r\n");
|
||||||
else {
|
else {
|
||||||
/* try to locate an entrance */
|
/* try to locate an entrance */
|
||||||
for (door = 0; door < NUM_OF_DIRS; door++)
|
for (door = 0; door < DIR_COUNT; door++)
|
||||||
if (EXIT(ch, door))
|
if (EXIT(ch, door))
|
||||||
if (EXIT(ch, door)->to_room != NOWHERE)
|
if (EXIT(ch, door)->to_room != NOWHERE)
|
||||||
if (!EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED) &&
|
if (!EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED) &&
|
||||||
|
|
@ -715,7 +719,7 @@ ACMD(do_leave)
|
||||||
if (OUTSIDE(ch))
|
if (OUTSIDE(ch))
|
||||||
send_to_char(ch, "You are outside.. where do you want to go?\r\n");
|
send_to_char(ch, "You are outside.. where do you want to go?\r\n");
|
||||||
else {
|
else {
|
||||||
for (door = 0; door < NUM_OF_DIRS; door++)
|
for (door = 0; door < DIR_COUNT; door++)
|
||||||
if (EXIT(ch, door))
|
if (EXIT(ch, door))
|
||||||
if (EXIT(ch, door)->to_room != NOWHERE)
|
if (EXIT(ch, door)->to_room != NOWHERE)
|
||||||
if (!EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED) &&
|
if (!EXIT_FLAGGED(EXIT(ch, door), EX_CLOSED) &&
|
||||||
|
|
|
||||||
|
|
@ -238,7 +238,7 @@ ACMD(do_flee)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 6; i++) {
|
for (i = 0; i < 6; i++) {
|
||||||
attempt = rand_number(0, NUM_OF_DIRS - 1); /* Select a random direction */
|
attempt = rand_number(0, DIR_COUNT - 1); /* Select a random direction */
|
||||||
if (CAN_GO(ch, attempt) &&
|
if (CAN_GO(ch, attempt) &&
|
||||||
!ROOM_FLAGGED(EXIT(ch, attempt)->to_room, ROOM_DEATH)) {
|
!ROOM_FLAGGED(EXIT(ch, attempt)->to_room, ROOM_DEATH)) {
|
||||||
act("$n panics, and attempts to flee!", TRUE, ch, 0, 0, TO_ROOM);
|
act("$n panics, and attempts to flee!", TRUE, ch, 0, 0, TO_ROOM);
|
||||||
|
|
|
||||||
|
|
@ -570,7 +570,7 @@ static void do_stat_room(struct char_data *ch, struct room_data *rm)
|
||||||
send_to_char(ch, "%s", CCNRM(ch, C_NRM));
|
send_to_char(ch, "%s", CCNRM(ch, C_NRM));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < NUM_OF_DIRS; i++) {
|
for (i = 0; i < DIR_COUNT; i++) {
|
||||||
char buf1[128];
|
char buf1[128];
|
||||||
|
|
||||||
if (!rm->dir_option[i])
|
if (!rm->dir_option[i])
|
||||||
|
|
@ -1687,11 +1687,11 @@ ACMD(do_admin)
|
||||||
}
|
}
|
||||||
} else if (is_abbrev(arg2, "default")) {
|
} else if (is_abbrev(arg2, "default")) {
|
||||||
/* Copy current flags */
|
/* Copy current flags */
|
||||||
for (i=0; i<AD_ARRAY_MAX; i++) tmp_adm[i] = ADM_FLAGS(ch)[i];
|
for (i=0; i<AD_ARRAY_MAX; i++) tmp_adm[i] = ADM_FLAGS(vict)[i];
|
||||||
set_default_admin_privs(ch, FALSE);
|
set_default_admin_privs(vict, FALSE);
|
||||||
/* Compare for changed flags */
|
/* Compare for changed flags */
|
||||||
for (i=0; i<AD_ARRAY_MAX; i++) {
|
for (i=0; i<AD_ARRAY_MAX; i++) {
|
||||||
if (tmp_adm[i] != ADM_FLAGS(ch)[i]) {
|
if (tmp_adm[i] != ADM_FLAGS(vict)[i]) {
|
||||||
changed = TRUE;
|
changed = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2904,7 +2904,7 @@ ACMD(do_show)
|
||||||
case 5:
|
case 5:
|
||||||
len = strlcpy(buf, "Errant Rooms\r\n------------\r\n", sizeof(buf));
|
len = strlcpy(buf, "Errant Rooms\r\n------------\r\n", sizeof(buf));
|
||||||
for (i = 0, k = 0; i <= top_of_world; i++)
|
for (i = 0, k = 0; i <= top_of_world; i++)
|
||||||
for (j = 0; j < NUM_OF_DIRS; j++) {
|
for (j = 0; j < DIR_COUNT; j++) {
|
||||||
if (!W_EXIT(i,j))
|
if (!W_EXIT(i,j))
|
||||||
continue;
|
continue;
|
||||||
if (W_EXIT(i,j)->to_room == 0) {
|
if (W_EXIT(i,j)->to_room == 0) {
|
||||||
|
|
@ -3654,7 +3654,7 @@ ACMD(do_links)
|
||||||
send_to_char(ch, "Zone %d is linked to the following zones:\r\n", zvnum);
|
send_to_char(ch, "Zone %d is linked to the following zones:\r\n", zvnum);
|
||||||
for (nr = 0; nr <= top_of_world && (GET_ROOM_VNUM(nr) <= last); nr++) {
|
for (nr = 0; nr <= top_of_world && (GET_ROOM_VNUM(nr) <= last); nr++) {
|
||||||
if (GET_ROOM_VNUM(nr) >= first) {
|
if (GET_ROOM_VNUM(nr) >= first) {
|
||||||
for (j = 0; j < NUM_OF_DIRS; j++) {
|
for (j = 0; j < DIR_COUNT; j++) {
|
||||||
if (world[nr].dir_option[j]) {
|
if (world[nr].dir_option[j]) {
|
||||||
to_room = world[nr].dir_option[j]->to_room;
|
to_room = world[nr].dir_option[j]->to_room;
|
||||||
if (to_room != NOWHERE && (zrnum != world[to_room].zone))
|
if (to_room != NOWHERE && (zrnum != world[to_room].zone))
|
||||||
|
|
@ -4023,7 +4023,7 @@ ACMD (do_zcheck)
|
||||||
send_to_char(ch, "\r\nChecking Rooms for limits...\r\n");
|
send_to_char(ch, "\r\nChecking Rooms for limits...\r\n");
|
||||||
for (i=0; i<top_of_world;i++) {
|
for (i=0; i<top_of_world;i++) {
|
||||||
if (world[i].zone==zrnum) {
|
if (world[i].zone==zrnum) {
|
||||||
for (j = 0; j < NUM_OF_DIRS; j++) {
|
for (j = 0; j < DIR_COUNT; j++) {
|
||||||
/*check for exit, but ignore off limits if you're in an offlimit zone*/
|
/*check for exit, but ignore off limits if you're in an offlimit zone*/
|
||||||
if (!world[i].dir_option[j])
|
if (!world[i].dir_option[j])
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -4089,11 +4089,11 @@ ACMD (do_zcheck)
|
||||||
for (i=0; i<top_of_world;i++) {
|
for (i=0; i<top_of_world;i++) {
|
||||||
if (world[i].zone==zrnum) {
|
if (world[i].zone==zrnum) {
|
||||||
m++;
|
m++;
|
||||||
for (j = 0, k = 0; j < NUM_OF_DIRS; j++)
|
for (j = 0, k = 0; j < DIR_COUNT; j++)
|
||||||
if (!world[i].dir_option[j])
|
if (!world[i].dir_option[j])
|
||||||
k++;
|
k++;
|
||||||
|
|
||||||
if (k == NUM_OF_DIRS)
|
if (k == DIR_COUNT)
|
||||||
l++;
|
l++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,8 @@
|
||||||
#define MAX_MAP_SIZE (CANVAS_WIDTH - 1)/4
|
#define MAX_MAP_SIZE (CANVAS_WIDTH - 1)/4
|
||||||
#define MAX_MAP CANVAS_WIDTH
|
#define MAX_MAP CANVAS_WIDTH
|
||||||
|
|
||||||
#define MAX_MAP_DIR 6
|
#define MAX_MAP_DIR 10
|
||||||
#define MAX_MAP_FOLLOW 4
|
#define MAX_MAP_FOLLOW 10
|
||||||
|
|
||||||
#define SECT_EMPTY 30 /* anything greater than num sect types */
|
#define SECT_EMPTY 30 /* anything greater than num sect types */
|
||||||
#define SECT_STRANGE (SECT_EMPTY + 1)
|
#define SECT_STRANGE (SECT_EMPTY + 1)
|
||||||
|
|
@ -47,10 +47,16 @@
|
||||||
#define DOOR_EW -2
|
#define DOOR_EW -2
|
||||||
#define DOOR_UP -3
|
#define DOOR_UP -3
|
||||||
#define DOOR_DOWN -4
|
#define DOOR_DOWN -4
|
||||||
#define VDOOR_NS -5
|
#define DOOR_DIAGNE -5
|
||||||
#define VDOOR_EW -6
|
#define DOOR_DIAGNW -6
|
||||||
#define DOOR_NONE -7
|
#define VDOOR_NS -7
|
||||||
#define NUM_DOOR_TYPES 7
|
#define VDOOR_EW -8
|
||||||
|
#define VDOOR_DIAGNE -9
|
||||||
|
#define VDOOR_DIAGNW -10
|
||||||
|
#define DOOR_UP_AND_NE -11
|
||||||
|
#define DOOR_DOWN_AND_SE -12
|
||||||
|
#define DOOR_NONE -13
|
||||||
|
#define NUM_DOOR_TYPES 13
|
||||||
|
|
||||||
#define MAP_CIRCLE 0
|
#define MAP_CIRCLE 0
|
||||||
#define MAP_RECTANGLE 1
|
#define MAP_RECTANGLE 1
|
||||||
|
|
@ -67,8 +73,14 @@ struct map_info_type
|
||||||
static struct map_info_type door_info[] =
|
static struct map_info_type door_info[] =
|
||||||
{
|
{
|
||||||
{ DOOR_NONE, " " },
|
{ DOOR_NONE, " " },
|
||||||
|
{ DOOR_DOWN_AND_SE, "@r-@n\\ " },
|
||||||
|
{ DOOR_UP_AND_NE, "@r+@n/ " },
|
||||||
|
{ VDOOR_DIAGNW, " @m+@n " },
|
||||||
|
{ VDOOR_DIAGNE, " @m+@n "},
|
||||||
{ VDOOR_EW, " @m+@n " },
|
{ VDOOR_EW, " @m+@n " },
|
||||||
{ VDOOR_NS, " @m+@n "},
|
{ VDOOR_NS, " @m+@n "},
|
||||||
|
{ DOOR_DIAGNW, " \\ " },
|
||||||
|
{ DOOR_DIAGNE, " / " },
|
||||||
{ DOOR_DOWN, "@r-@n " },
|
{ DOOR_DOWN, "@r-@n " },
|
||||||
{ DOOR_UP, "@r+@n " },
|
{ DOOR_UP, "@r+@n " },
|
||||||
{ DOOR_EW, " - " },
|
{ DOOR_EW, " - " },
|
||||||
|
|
@ -78,8 +90,14 @@ static struct map_info_type door_info[] =
|
||||||
static struct map_info_type compact_door_info[] =
|
static struct map_info_type compact_door_info[] =
|
||||||
{
|
{
|
||||||
{ DOOR_NONE, " " },
|
{ DOOR_NONE, " " },
|
||||||
|
{ DOOR_DOWN_AND_SE, "@R\\@n" },
|
||||||
|
{ DOOR_UP_AND_NE, "@R/@n" },
|
||||||
|
{ VDOOR_DIAGNW, "@m+@n" },
|
||||||
|
{ VDOOR_DIAGNE, "@m+@n"},
|
||||||
{ VDOOR_EW, " @m+@n " },
|
{ VDOOR_EW, " @m+@n " },
|
||||||
{ VDOOR_NS, " @m+@n "},
|
{ VDOOR_NS, " @m+@n "},
|
||||||
|
{ DOOR_DIAGNW,"\\" },
|
||||||
|
{ DOOR_DIAGNE,"/" },
|
||||||
{ DOOR_DOWN, "@r-@n" },
|
{ DOOR_DOWN, "@r-@n" },
|
||||||
{ DOOR_UP, "@r+@n" },
|
{ DOOR_UP, "@r+@n" },
|
||||||
{ DOOR_EW, "-" },
|
{ DOOR_EW, "-" },
|
||||||
|
|
@ -165,10 +183,16 @@ static struct map_info_type world_map_info[] =
|
||||||
|
|
||||||
|
|
||||||
static int map[MAX_MAP][MAX_MAP];
|
static int map[MAX_MAP][MAX_MAP];
|
||||||
|
/*
|
||||||
static int offsets[4][2] ={ {-2, 0},{ 0, 2},{ 2, 0},{ 0, -2} };
|
static int offsets[4][2] ={ {-2, 0},{ 0, 2},{ 2, 0},{ 0, -2} };
|
||||||
static int offsets_worldmap[4][2] ={ {-1, 0},{ 0, 1},{ 1, 0},{ 0, -1} };
|
static int offsets_worldmap[4][2] ={ {-1, 0},{ 0, 1},{ 1, 0},{ 0, -1} };
|
||||||
static int door_offsets[6][2] ={ {-1, 0},{ 0, 1},{ 1, 0},{ 0, -1},{ -1, 1},{ 1, 1} };
|
static int door_offsets[6][2] ={ {-1, 0},{ 0, 1},{ 1, 0},{ 0, -1},{ -1, 1},{ 1, 1} };
|
||||||
static int door_marks[6] = { DOOR_NS, DOOR_EW, DOOR_NS, DOOR_EW, DOOR_UP, DOOR_DOWN };
|
static int door_marks[6] = { DOOR_NS, DOOR_EW, DOOR_NS, DOOR_EW, DOOR_UP, DOOR_DOWN };
|
||||||
|
*/
|
||||||
|
static int offsets[10][2] ={ {-2, 0},{ 0, 2},{ 2, 0},{ 0, -2},{0, 0},{ 0, 0},{ -2, -2},{ -2, 2},{2, 2},{ 2, -2} };
|
||||||
|
static int offsets_worldmap[10][2] ={ {-1, 0},{ 0, 1},{ 1, 0},{ 0, -1},{0, 0},{ 0, 0},{ -1, -1},{ -1, 1},{1, 1},{ 1, -1} };
|
||||||
|
static int door_offsets[10][2] ={ {-1, 0},{ 0, 1},{ 1, 0},{ 0, -1},{ -1, 1},{ 1, 1},{ -1, -1},{ -1, 1},{ 1, 1},{ 1, -1} };
|
||||||
|
static int door_marks[10] = { DOOR_NS, DOOR_EW, DOOR_NS, DOOR_EW, DOOR_UP, DOOR_DOWN, DOOR_DIAGNW, DOOR_DIAGNE, DOOR_DIAGNW, DOOR_DIAGNE};
|
||||||
static int vdoor_marks[4] = { VDOOR_NS, VDOOR_EW, VDOOR_NS, VDOOR_EW };
|
static int vdoor_marks[4] = { VDOOR_NS, VDOOR_EW, VDOOR_NS, VDOOR_EW };
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* End Local (File Scope) Defines and Global Variables
|
* End Local (File Scope) Defines and Global Variables
|
||||||
|
|
@ -234,7 +258,9 @@ static void MapArea(room_rnum room, struct char_data *ch, int x, int y, int min,
|
||||||
|
|
||||||
if ( (pexit = world[room].dir_option[door]) != NULL &&
|
if ( (pexit = world[room].dir_option[door]) != NULL &&
|
||||||
(pexit->to_room > 0 ) && (pexit->to_room != NOWHERE) &&
|
(pexit->to_room > 0 ) && (pexit->to_room != NOWHERE) &&
|
||||||
(!IS_SET(pexit->exit_info, EX_CLOSED))) { /* A real exit */
|
(!IS_SET(pexit->exit_info, EX_CLOSED)) &&
|
||||||
|
(!IS_SET(pexit->exit_info, EX_HIDDEN) || ADM_FLAGGED(ch, ADM_SEESECRET)) )
|
||||||
|
{ /* A real exit */
|
||||||
|
|
||||||
/* But is the door here... */
|
/* But is the door here... */
|
||||||
switch (door) {
|
switch (door) {
|
||||||
|
|
@ -250,6 +276,18 @@ static void MapArea(room_rnum room, struct char_data *ch, int x, int y, int min,
|
||||||
case WEST:
|
case WEST:
|
||||||
if(ypos > 0 || xpos!=x_exit_pos) continue;
|
if(ypos > 0 || xpos!=x_exit_pos) continue;
|
||||||
break;
|
break;
|
||||||
|
case NORTHWEST:
|
||||||
|
if(xpos > 0 || ypos!=y_exit_pos || ypos > 0 || xpos!=x_exit_pos) continue;
|
||||||
|
break;
|
||||||
|
case NORTHEAST:
|
||||||
|
if(xpos > 0 || ypos!=y_exit_pos || ypos < ew_size || xpos!=x_exit_pos) continue;
|
||||||
|
break;
|
||||||
|
case SOUTHEAST:
|
||||||
|
if(xpos < ns_size || ypos!=y_exit_pos || ypos < ew_size || xpos!=x_exit_pos) continue;
|
||||||
|
break;
|
||||||
|
case SOUTHWEST:
|
||||||
|
if(xpos < ns_size || ypos!=y_exit_pos || ypos > 0 || xpos!=x_exit_pos) continue;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -263,8 +301,21 @@ static void MapArea(room_rnum room, struct char_data *ch, int x, int y, int min,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!worldmap)
|
if(!worldmap) {
|
||||||
map[x+door_offsets[door][0]][y+door_offsets[door][1]] = door_marks[door] ;
|
if ((map[x+door_offsets[door][0]][y+door_offsets[door][1]] == DOOR_NONE) ||
|
||||||
|
(map[x+door_offsets[door][0]][y+door_offsets[door][1]] == SECT_EMPTY) ) {
|
||||||
|
map[x+door_offsets[door][0]][y+door_offsets[door][1]] = door_marks[door];
|
||||||
|
} else {
|
||||||
|
if ( ((door == NORTHEAST) && (map[x+door_offsets[door][0]][y+door_offsets[door][1]] == DOOR_UP)) ||
|
||||||
|
((door == UP) && (map[x+door_offsets[door][0]][y+door_offsets[door][1]] == DOOR_DIAGNE)) ) {
|
||||||
|
map[x+door_offsets[door][0]][y+door_offsets[door][1]] = DOOR_UP_AND_NE;
|
||||||
|
}
|
||||||
|
else if ( ((door == SOUTHEAST) && (map[x+door_offsets[door][0]][y+door_offsets[door][1]] == DOOR_DOWN)) ||
|
||||||
|
((door == DOWN) && (map[x+door_offsets[door][0]][y+door_offsets[door][1]] == DOOR_DIAGNW)) ) {
|
||||||
|
map[x+door_offsets[door][0]][y+door_offsets[door][1]] = DOOR_DOWN_AND_SE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
prospect_xpos = prospect_ypos = 0;
|
prospect_xpos = prospect_ypos = 0;
|
||||||
switch (door) {
|
switch (door) {
|
||||||
|
|
@ -277,6 +328,14 @@ static void MapArea(room_rnum room, struct char_data *ch, int x, int y, int min,
|
||||||
prospect_ypos = ew_size;
|
prospect_ypos = ew_size;
|
||||||
case EAST:
|
case EAST:
|
||||||
prospect_xpos = world[prospect_room].dir_option[rev_dir[door]] ? x_exit_pos : ns_size/2;
|
prospect_xpos = world[prospect_room].dir_option[rev_dir[door]] ? x_exit_pos : ns_size/2;
|
||||||
|
break;
|
||||||
|
case NORTHEAST:
|
||||||
|
case NORTHWEST:
|
||||||
|
case SOUTHEAST:
|
||||||
|
case SOUTHWEST:
|
||||||
|
prospect_xpos = world[prospect_room].dir_option[rev_dir[door]] ? x_exit_pos : ns_size/2;
|
||||||
|
prospect_ypos = world[prospect_room].dir_option[rev_dir[door]] ? y_exit_pos : ew_size/2;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(worldmap) {
|
if(worldmap) {
|
||||||
|
|
|
||||||
13
src/cedit.c
13
src/cedit.c
|
|
@ -101,6 +101,7 @@ static void cedit_setup(struct descriptor_data *d)
|
||||||
OLC_CONFIG(d)->play.track_through_doors = CONFIG_TRACK_T_DOORS;
|
OLC_CONFIG(d)->play.track_through_doors = CONFIG_TRACK_T_DOORS;
|
||||||
OLC_CONFIG(d)->play.no_mort_to_immort = CONFIG_NO_MORT_TO_IMMORT;
|
OLC_CONFIG(d)->play.no_mort_to_immort = CONFIG_NO_MORT_TO_IMMORT;
|
||||||
OLC_CONFIG(d)->play.disp_closed_doors = CONFIG_DISP_CLOSED_DOORS;
|
OLC_CONFIG(d)->play.disp_closed_doors = CONFIG_DISP_CLOSED_DOORS;
|
||||||
|
OLC_CONFIG(d)->play.diagonal_dirs = CONFIG_DIAGONAL_DIRS;
|
||||||
OLC_CONFIG(d)->play.map_option = CONFIG_MAP;
|
OLC_CONFIG(d)->play.map_option = CONFIG_MAP;
|
||||||
OLC_CONFIG(d)->play.map_size = CONFIG_MAP_SIZE;
|
OLC_CONFIG(d)->play.map_size = CONFIG_MAP_SIZE;
|
||||||
OLC_CONFIG(d)->play.minimap_size = CONFIG_MINIMAP_SIZE;
|
OLC_CONFIG(d)->play.minimap_size = CONFIG_MINIMAP_SIZE;
|
||||||
|
|
@ -200,6 +201,7 @@ static void cedit_save_internally(struct descriptor_data *d)
|
||||||
CONFIG_TRACK_T_DOORS = OLC_CONFIG(d)->play.track_through_doors;
|
CONFIG_TRACK_T_DOORS = OLC_CONFIG(d)->play.track_through_doors;
|
||||||
CONFIG_NO_MORT_TO_IMMORT = OLC_CONFIG(d)->play.no_mort_to_immort;
|
CONFIG_NO_MORT_TO_IMMORT = OLC_CONFIG(d)->play.no_mort_to_immort;
|
||||||
CONFIG_DISP_CLOSED_DOORS = OLC_CONFIG(d)->play.disp_closed_doors;
|
CONFIG_DISP_CLOSED_DOORS = OLC_CONFIG(d)->play.disp_closed_doors;
|
||||||
|
CONFIG_DIAGONAL_DIRS = OLC_CONFIG(d)->play.diagonal_dirs;
|
||||||
CONFIG_MAP = OLC_CONFIG(d)->play.map_option;
|
CONFIG_MAP = OLC_CONFIG(d)->play.map_option;
|
||||||
CONFIG_MAP_SIZE = OLC_CONFIG(d)->play.map_size;
|
CONFIG_MAP_SIZE = OLC_CONFIG(d)->play.map_size;
|
||||||
CONFIG_MINIMAP_SIZE = OLC_CONFIG(d)->play.minimap_size;
|
CONFIG_MINIMAP_SIZE = OLC_CONFIG(d)->play.minimap_size;
|
||||||
|
|
@ -365,6 +367,8 @@ int save_config( IDXTYPE nowhere )
|
||||||
"no_mort_to_immort = %d\n\n", CONFIG_NO_MORT_TO_IMMORT);
|
"no_mort_to_immort = %d\n\n", CONFIG_NO_MORT_TO_IMMORT);
|
||||||
fprintf(fl, "* Should closed doors be shown on autoexit / exit?\n"
|
fprintf(fl, "* Should closed doors be shown on autoexit / exit?\n"
|
||||||
"disp_closed_doors = %d\n\n", CONFIG_DISP_CLOSED_DOORS);
|
"disp_closed_doors = %d\n\n", CONFIG_DISP_CLOSED_DOORS);
|
||||||
|
fprintf(fl, "* Are diagonal directions enabled?\n"
|
||||||
|
"diagonal_dirs_enabled = %d\n\n", CONFIG_DIAGONAL_DIRS);
|
||||||
fprintf(fl, "* Who can use the map functions? 0=off, 1=on, 2=imm_only\n"
|
fprintf(fl, "* Who can use the map functions? 0=off, 1=on, 2=imm_only\n"
|
||||||
"map_option = %d\n\n", CONFIG_MAP);
|
"map_option = %d\n\n", CONFIG_MAP);
|
||||||
fprintf(fl, "* Default size of map shown by 'map' command\n"
|
fprintf(fl, "* Default size of map shown by 'map' command\n"
|
||||||
|
|
@ -603,7 +607,8 @@ static void cedit_disp_game_play_options(struct descriptor_data *d)
|
||||||
"%sO%s) Objects Load Into Inventory : %s%s\r\n"
|
"%sO%s) Objects Load Into Inventory : %s%s\r\n"
|
||||||
"%sP%s) Track Through Doors : %s%s\r\n"
|
"%sP%s) Track Through Doors : %s%s\r\n"
|
||||||
"%sR%s) Display Closed Doors : %s%s\r\n"
|
"%sR%s) Display Closed Doors : %s%s\r\n"
|
||||||
"%sS%s) Mortals Level To Immortal : %s%s\r\n"
|
"%sS%s) Diagonal Directions : %s%s\r\n"
|
||||||
|
"%sT%s) Mortals Level To Immortal : %s%s\r\n"
|
||||||
"%s1%s) OK Message Text : %s%s"
|
"%s1%s) OK Message Text : %s%s"
|
||||||
"%s2%s) NOPERSON Message Text : %s%s"
|
"%s2%s) NOPERSON Message Text : %s%s"
|
||||||
"%s3%s) NOEFFECT Message Text : %s%s"
|
"%s3%s) NOEFFECT Message Text : %s%s"
|
||||||
|
|
@ -631,6 +636,7 @@ static void cedit_disp_game_play_options(struct descriptor_data *d)
|
||||||
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.load_into_inventory),
|
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.load_into_inventory),
|
||||||
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.track_through_doors),
|
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.track_through_doors),
|
||||||
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.disp_closed_doors),
|
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.disp_closed_doors),
|
||||||
|
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.diagonal_dirs),
|
||||||
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.no_mort_to_immort),
|
grn, nrm, cyn, CHECK_VAR(OLC_CONFIG(d)->play.no_mort_to_immort),
|
||||||
|
|
||||||
grn, nrm, cyn, OLC_CONFIG(d)->play.OK,
|
grn, nrm, cyn, OLC_CONFIG(d)->play.OK,
|
||||||
|
|
@ -952,6 +958,11 @@ void cedit_parse(struct descriptor_data *d, char *arg)
|
||||||
|
|
||||||
case 's':
|
case 's':
|
||||||
case 'S':
|
case 'S':
|
||||||
|
TOGGLE_VAR(OLC_CONFIG(d)->play.diagonal_dirs);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 't':
|
||||||
|
case 'T':
|
||||||
TOGGLE_VAR(OLC_CONFIG(d)->play.no_mort_to_immort);
|
TOGGLE_VAR(OLC_CONFIG(d)->play.no_mort_to_immort);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,10 @@ int track_through_doors = YES;
|
||||||
* the top level that people can advance to in gain_exp() in limits.c */
|
* the top level that people can advance to in gain_exp() in limits.c */
|
||||||
int no_mort_to_immort = YES;
|
int no_mort_to_immort = YES;
|
||||||
|
|
||||||
|
/* Are diagonal directions enabled?
|
||||||
|
* If set to NO, then only the 6 directions n,e,s,w,u,d are allowed */
|
||||||
|
int diagonal_dirs_enabled = NO;
|
||||||
|
|
||||||
/* RENT/CRASHSAVE OPTIONS */
|
/* RENT/CRASHSAVE OPTIONS */
|
||||||
/* Should the MUD allow you to 'rent' for free? (i.e. if you just quit, your
|
/* Should the MUD allow you to 'rent' for free? (i.e. if you just quit, your
|
||||||
* objects are saved at no cost). */
|
* objects are saved at no cost). */
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ extern const char *NOPERSON;
|
||||||
extern const char *NOEFFECT;
|
extern const char *NOEFFECT;
|
||||||
extern int track_through_doors;
|
extern int track_through_doors;
|
||||||
extern int no_mort_to_immort;
|
extern int no_mort_to_immort;
|
||||||
|
extern int diagonal_dirs_enabled;
|
||||||
extern int free_rent;
|
extern int free_rent;
|
||||||
extern int max_obj_save;
|
extern int max_obj_save;
|
||||||
extern int min_rent_cost;
|
extern int min_rent_cost;
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,25 @@ const char *dirs[] =
|
||||||
"west",
|
"west",
|
||||||
"up",
|
"up",
|
||||||
"down",
|
"down",
|
||||||
|
"northwest", /* Diagonals only used if CONFIG_DIAGONAL_DIRS is set */
|
||||||
|
"northeast",
|
||||||
|
"southeast",
|
||||||
|
"southwest",
|
||||||
|
"\n"
|
||||||
|
};
|
||||||
|
|
||||||
|
const char *autoexits[] =
|
||||||
|
{
|
||||||
|
"n",
|
||||||
|
"e",
|
||||||
|
"s",
|
||||||
|
"w",
|
||||||
|
"u",
|
||||||
|
"d",
|
||||||
|
"nw",
|
||||||
|
"ne",
|
||||||
|
"se",
|
||||||
|
"sw",
|
||||||
"\n"
|
"\n"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -854,7 +873,11 @@ int rev_dir[] =
|
||||||
NORTH,
|
NORTH,
|
||||||
EAST,
|
EAST,
|
||||||
DOWN,
|
DOWN,
|
||||||
UP
|
UP,
|
||||||
|
SOUTHEAST,
|
||||||
|
SOUTHWEST,
|
||||||
|
NORTHWEST,
|
||||||
|
NORTHEAST
|
||||||
};
|
};
|
||||||
|
|
||||||
/** How much movement is lost moving through a particular sector type. */
|
/** How much movement is lost moving through a particular sector type. */
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
extern const char *tbamud_version;
|
extern const char *tbamud_version;
|
||||||
extern const char *dirs[];
|
extern const char *dirs[];
|
||||||
|
extern const char *autoexits[];
|
||||||
extern const char *admin_level_names[];
|
extern const char *admin_level_names[];
|
||||||
extern const char *admin_flag_names[];
|
extern const char *admin_flag_names[];
|
||||||
extern const char *admin_flags[];
|
extern const char *admin_flags[];
|
||||||
|
|
|
||||||
18
src/db.c
18
src/db.c
|
|
@ -508,7 +508,7 @@ void destroy_db(void)
|
||||||
/* free script proto list */
|
/* free script proto list */
|
||||||
free_proto_script(&world[cnt], WLD_TRIGGER);
|
free_proto_script(&world[cnt], WLD_TRIGGER);
|
||||||
|
|
||||||
for (itr = 0; itr < NUM_OF_DIRS; itr++) {
|
for (itr = 0; itr < NUM_OF_DIRS; itr++) { /* NUM_OF_DIRS here, not DIR_COUNT */
|
||||||
if (!world[cnt].dir_option[itr])
|
if (!world[cnt].dir_option[itr])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
@ -1243,7 +1243,7 @@ void parse_room(FILE *fl, int virtual_nr)
|
||||||
world[room_nr].people = NULL;
|
world[room_nr].people = NULL;
|
||||||
world[room_nr].light = 0; /* Zero light sources */
|
world[room_nr].light = 0; /* Zero light sources */
|
||||||
|
|
||||||
for (i = 0; i < NUM_OF_DIRS; i++)
|
for (i = 0; i < NUM_OF_DIRS; i++) /* NUM_OF_DIRS used here, not DIR_COUNT */
|
||||||
world[room_nr].dir_option[i] = NULL;
|
world[room_nr].dir_option[i] = NULL;
|
||||||
|
|
||||||
world[room_nr].ex_description = NULL;
|
world[room_nr].ex_description = NULL;
|
||||||
|
|
@ -1303,6 +1303,11 @@ void setup_dir(FILE *fl, int room, int dir)
|
||||||
|
|
||||||
snprintf(buf2, sizeof(buf2), "room #%d, direction D%d", GET_ROOM_VNUM(room)+1, dir);
|
snprintf(buf2, sizeof(buf2), "room #%d, direction D%d", GET_ROOM_VNUM(room)+1, dir);
|
||||||
|
|
||||||
|
if (!CONFIG_DIAGONAL_DIRS && IS_DIAGONAL(dir)) {
|
||||||
|
log("Warning: Diagonal direction disabled: %s", buf2);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
CREATE(world[room].dir_option[dir], struct room_direction_data, 1);
|
CREATE(world[room].dir_option[dir], struct room_direction_data, 1);
|
||||||
world[room].dir_option[dir]->general_description = fread_string(fl, buf2);
|
world[room].dir_option[dir]->general_description = fread_string(fl, buf2);
|
||||||
world[room].dir_option[dir]->keyword = fread_string(fl, buf2);
|
world[room].dir_option[dir]->keyword = fread_string(fl, buf2);
|
||||||
|
|
@ -1319,6 +1324,10 @@ void setup_dir(FILE *fl, int room, int dir)
|
||||||
world[room].dir_option[dir]->exit_info = EX_ISDOOR;
|
world[room].dir_option[dir]->exit_info = EX_ISDOOR;
|
||||||
else if (t[0] == 2)
|
else if (t[0] == 2)
|
||||||
world[room].dir_option[dir]->exit_info = EX_ISDOOR | EX_PICKPROOF;
|
world[room].dir_option[dir]->exit_info = EX_ISDOOR | EX_PICKPROOF;
|
||||||
|
else if (t[0] == 3)
|
||||||
|
world[room].dir_option[dir]->exit_info = EX_ISDOOR | EX_HIDDEN;
|
||||||
|
else if (t[0] == 4)
|
||||||
|
world[room].dir_option[dir]->exit_info = EX_ISDOOR | EX_PICKPROOF | EX_HIDDEN;
|
||||||
else
|
else
|
||||||
world[room].dir_option[dir]->exit_info = 0;
|
world[room].dir_option[dir]->exit_info = 0;
|
||||||
|
|
||||||
|
|
@ -2616,7 +2625,7 @@ void reset_zone(zone_rnum zone)
|
||||||
|
|
||||||
|
|
||||||
case 'D': /* set state of door */
|
case 'D': /* set state of door */
|
||||||
if (ZCMD.arg2 < 0 || ZCMD.arg2 >= NUM_OF_DIRS ||
|
if (ZCMD.arg2 < 0 || ZCMD.arg2 >= DIR_COUNT ||
|
||||||
(world[ZCMD.arg1].dir_option[ZCMD.arg2] == NULL)) {
|
(world[ZCMD.arg1].dir_option[ZCMD.arg2] == NULL)) {
|
||||||
char error[MAX_INPUT_LENGTH];
|
char error[MAX_INPUT_LENGTH];
|
||||||
snprintf(error, sizeof(error), "door does not exist in room %d - dir %d, command disabled", world[ZCMD.arg1].number, ZCMD.arg2);
|
snprintf(error, sizeof(error), "door does not exist in room %d - dir %d, command disabled", world[ZCMD.arg1].number, ZCMD.arg2);
|
||||||
|
|
@ -3710,6 +3719,7 @@ static void load_default_config( void )
|
||||||
CONFIG_TRACK_T_DOORS = track_through_doors;
|
CONFIG_TRACK_T_DOORS = track_through_doors;
|
||||||
CONFIG_NO_MORT_TO_IMMORT = no_mort_to_immort;
|
CONFIG_NO_MORT_TO_IMMORT = no_mort_to_immort;
|
||||||
CONFIG_DISP_CLOSED_DOORS = display_closed_doors;
|
CONFIG_DISP_CLOSED_DOORS = display_closed_doors;
|
||||||
|
CONFIG_DIAGONAL_DIRS = diagonal_dirs_enabled;
|
||||||
CONFIG_MAP = map_option;
|
CONFIG_MAP = map_option;
|
||||||
CONFIG_MAP_SIZE = default_map_size;
|
CONFIG_MAP_SIZE = default_map_size;
|
||||||
CONFIG_MINIMAP_SIZE = default_minimap_size;
|
CONFIG_MINIMAP_SIZE = default_minimap_size;
|
||||||
|
|
@ -3804,6 +3814,8 @@ void load_config( void )
|
||||||
case 'd':
|
case 'd':
|
||||||
if (!str_cmp(tag, "display_closed_doors"))
|
if (!str_cmp(tag, "display_closed_doors"))
|
||||||
CONFIG_DISP_CLOSED_DOORS = num;
|
CONFIG_DISP_CLOSED_DOORS = num;
|
||||||
|
else if (!str_cmp(tag, "diagonal_dirs_enabled"))
|
||||||
|
CONFIG_DIAGONAL_DIRS = num;
|
||||||
else if (!str_cmp(tag, "dts_are_dumps"))
|
else if (!str_cmp(tag, "dts_are_dumps"))
|
||||||
CONFIG_DTS_ARE_DUMPS = num;
|
CONFIG_DTS_ARE_DUMPS = num;
|
||||||
else if (!str_cmp(tag, "donation_room_1"))
|
else if (!str_cmp(tag, "donation_room_1"))
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ ACMD(do_masound)
|
||||||
skip_spaces(&argument);
|
skip_spaces(&argument);
|
||||||
|
|
||||||
was_in_room = IN_ROOM(ch);
|
was_in_room = IN_ROOM(ch);
|
||||||
for (door = 0; door < NUM_OF_DIRS; door++)
|
for (door = 0; door < DIR_COUNT; door++)
|
||||||
{
|
{
|
||||||
struct room_direction_data *newexit;
|
struct room_direction_data *newexit;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -573,11 +573,11 @@ static OCMD(do_oasound)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((room = obj_room(obj)) == NOWHERE) {
|
if ((room = obj_room(obj)) == NOWHERE) {
|
||||||
obj_log(obj, "oecho called by object in NOWHERE");
|
obj_log(obj, "oasound called by object in NOWHERE");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (door = 0; door < NUM_OF_DIRS; door++) {
|
for (door = 0; door < DIR_COUNT; door++) {
|
||||||
if (world[room].dir_option[door] != NULL &&
|
if (world[room].dir_option[door] != NULL &&
|
||||||
(world[room].dir_option[door])->to_room != NOWHERE &&
|
(world[room].dir_option[door])->to_room != NOWHERE &&
|
||||||
(world[room].dir_option[door])->to_room != room &&
|
(world[room].dir_option[door])->to_room != room &&
|
||||||
|
|
|
||||||
|
|
@ -216,7 +216,7 @@ int greet_mtrigger(char_data *actor, int dir)
|
||||||
if (((IS_SET(GET_TRIG_TYPE(t), MTRIG_GREET) && CAN_SEE(ch, actor)) ||
|
if (((IS_SET(GET_TRIG_TYPE(t), MTRIG_GREET) && CAN_SEE(ch, actor)) ||
|
||||||
IS_SET(GET_TRIG_TYPE(t), MTRIG_GREET_ALL)) &&
|
IS_SET(GET_TRIG_TYPE(t), MTRIG_GREET_ALL)) &&
|
||||||
!GET_TRIG_DEPTH(t) && (rand_number(1, 100) <= GET_TRIG_NARG(t))) {
|
!GET_TRIG_DEPTH(t) && (rand_number(1, 100) <= GET_TRIG_NARG(t))) {
|
||||||
if (dir>=0 && dir < NUM_OF_DIRS)
|
if (dir>=0 && dir < DIR_COUNT)
|
||||||
add_var(&GET_TRIG_VARS(t), "direction", dirs[rev_dir[dir]], 0);
|
add_var(&GET_TRIG_VARS(t), "direction", dirs[rev_dir[dir]], 0);
|
||||||
else
|
else
|
||||||
add_var(&GET_TRIG_VARS(t), "direction", "none", 0);
|
add_var(&GET_TRIG_VARS(t), "direction", "none", 0);
|
||||||
|
|
@ -569,7 +569,7 @@ int leave_mtrigger(char_data *actor, int dir)
|
||||||
for (t = TRIGGERS(SCRIPT(ch)); t; t = t->next) {
|
for (t = TRIGGERS(SCRIPT(ch)); t; t = t->next) {
|
||||||
if ((IS_SET(GET_TRIG_TYPE(t), MTRIG_LEAVE) && CAN_SEE(ch, actor)) &&
|
if ((IS_SET(GET_TRIG_TYPE(t), MTRIG_LEAVE) && CAN_SEE(ch, actor)) &&
|
||||||
!GET_TRIG_DEPTH(t) && (rand_number(1, 100) <= GET_TRIG_NARG(t))) {
|
!GET_TRIG_DEPTH(t) && (rand_number(1, 100) <= GET_TRIG_NARG(t))) {
|
||||||
if (dir>=0 && dir < NUM_OF_DIRS)
|
if (dir>=0 && dir < DIR_COUNT)
|
||||||
add_var(&GET_TRIG_VARS(t), "direction", dirs[dir], 0);
|
add_var(&GET_TRIG_VARS(t), "direction", dirs[dir], 0);
|
||||||
else
|
else
|
||||||
add_var(&GET_TRIG_VARS(t), "direction", "none", 0);
|
add_var(&GET_TRIG_VARS(t), "direction", "none", 0);
|
||||||
|
|
@ -597,7 +597,7 @@ int door_mtrigger(char_data *actor, int subcmd, int dir)
|
||||||
if (IS_SET(GET_TRIG_TYPE(t), MTRIG_DOOR) && CAN_SEE(ch, actor) &&
|
if (IS_SET(GET_TRIG_TYPE(t), MTRIG_DOOR) && CAN_SEE(ch, actor) &&
|
||||||
!GET_TRIG_DEPTH(t) && (rand_number(1, 100) <= GET_TRIG_NARG(t))) {
|
!GET_TRIG_DEPTH(t) && (rand_number(1, 100) <= GET_TRIG_NARG(t))) {
|
||||||
add_var(&GET_TRIG_VARS(t), "cmd", cmd_door[subcmd], 0);
|
add_var(&GET_TRIG_VARS(t), "cmd", cmd_door[subcmd], 0);
|
||||||
if (dir>=0 && dir < NUM_OF_DIRS)
|
if (dir>=0 && dir < DIR_COUNT)
|
||||||
add_var(&GET_TRIG_VARS(t), "direction", dirs[dir], 0);
|
add_var(&GET_TRIG_VARS(t), "direction", dirs[dir], 0);
|
||||||
else
|
else
|
||||||
add_var(&GET_TRIG_VARS(t), "direction", "none", 0);
|
add_var(&GET_TRIG_VARS(t), "direction", "none", 0);
|
||||||
|
|
@ -916,7 +916,7 @@ int leave_otrigger(room_data *room, char_data *actor, int dir)
|
||||||
for (t = TRIGGERS(SCRIPT(obj)); t; t = t->next) {
|
for (t = TRIGGERS(SCRIPT(obj)); t; t = t->next) {
|
||||||
if (TRIGGER_CHECK(t, OTRIG_LEAVE) &&
|
if (TRIGGER_CHECK(t, OTRIG_LEAVE) &&
|
||||||
(rand_number(1, 100) <= GET_TRIG_NARG(t))) {
|
(rand_number(1, 100) <= GET_TRIG_NARG(t))) {
|
||||||
if (dir>=0 && dir < NUM_OF_DIRS)
|
if (dir>=0 && dir < DIR_COUNT)
|
||||||
add_var(&GET_TRIG_VARS(t), "direction", dirs[dir], 0);
|
add_var(&GET_TRIG_VARS(t), "direction", dirs[dir], 0);
|
||||||
else
|
else
|
||||||
add_var(&GET_TRIG_VARS(t), "direction", "none", 0);
|
add_var(&GET_TRIG_VARS(t), "direction", "none", 0);
|
||||||
|
|
@ -1029,7 +1029,7 @@ int enter_wtrigger(struct room_data *room, char_data *actor, int dir)
|
||||||
for (t = TRIGGERS(SCRIPT(room)); t; t = t->next) {
|
for (t = TRIGGERS(SCRIPT(room)); t; t = t->next) {
|
||||||
if (TRIGGER_CHECK(t, WTRIG_ENTER) &&
|
if (TRIGGER_CHECK(t, WTRIG_ENTER) &&
|
||||||
(rand_number(1, 100) <= GET_TRIG_NARG(t))) {
|
(rand_number(1, 100) <= GET_TRIG_NARG(t))) {
|
||||||
if (dir>=0 && dir < NUM_OF_DIRS)
|
if (dir>=0 && dir < DIR_COUNT)
|
||||||
add_var(&GET_TRIG_VARS(t), "direction", dirs[rev_dir[dir]], 0);
|
add_var(&GET_TRIG_VARS(t), "direction", dirs[rev_dir[dir]], 0);
|
||||||
else
|
else
|
||||||
add_var(&GET_TRIG_VARS(t), "direction", "none", 0);
|
add_var(&GET_TRIG_VARS(t), "direction", "none", 0);
|
||||||
|
|
@ -1181,7 +1181,7 @@ int leave_wtrigger(struct room_data *room, char_data *actor, int dir)
|
||||||
for (t = TRIGGERS(SCRIPT(room)); t; t = t->next) {
|
for (t = TRIGGERS(SCRIPT(room)); t; t = t->next) {
|
||||||
if (TRIGGER_CHECK(t, WTRIG_LEAVE) &&
|
if (TRIGGER_CHECK(t, WTRIG_LEAVE) &&
|
||||||
(rand_number(1, 100) <= GET_TRIG_NARG(t))) {
|
(rand_number(1, 100) <= GET_TRIG_NARG(t))) {
|
||||||
if (dir>=0 && dir < NUM_OF_DIRS)
|
if (dir>=0 && dir < DIR_COUNT)
|
||||||
add_var(&GET_TRIG_VARS(t), "direction", dirs[dir], 0);
|
add_var(&GET_TRIG_VARS(t), "direction", dirs[dir], 0);
|
||||||
else
|
else
|
||||||
add_var(&GET_TRIG_VARS(t), "direction", "none", 0);
|
add_var(&GET_TRIG_VARS(t), "direction", "none", 0);
|
||||||
|
|
@ -1207,7 +1207,7 @@ int door_wtrigger(char_data *actor, int subcmd, int dir)
|
||||||
if (TRIGGER_CHECK(t, WTRIG_DOOR) &&
|
if (TRIGGER_CHECK(t, WTRIG_DOOR) &&
|
||||||
(rand_number(1, 100) <= GET_TRIG_NARG(t))) {
|
(rand_number(1, 100) <= GET_TRIG_NARG(t))) {
|
||||||
add_var(&GET_TRIG_VARS(t), "cmd", cmd_door[subcmd], 0);
|
add_var(&GET_TRIG_VARS(t), "cmd", cmd_door[subcmd], 0);
|
||||||
if (dir>=0 && dir < NUM_OF_DIRS)
|
if (dir>=0 && dir < DIR_COUNT)
|
||||||
add_var(&GET_TRIG_VARS(t), "direction", dirs[dir], 0);
|
add_var(&GET_TRIG_VARS(t), "direction", dirs[dir], 0);
|
||||||
else
|
else
|
||||||
add_var(&GET_TRIG_VARS(t), "direction", "none", 0);
|
add_var(&GET_TRIG_VARS(t), "direction", "none", 0);
|
||||||
|
|
|
||||||
|
|
@ -506,7 +506,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
|
||||||
} else {
|
} else {
|
||||||
doors = 0;
|
doors = 0;
|
||||||
room = &world[in_room];
|
room = &world[in_room];
|
||||||
for (i = 0; i < NUM_OF_DIRS ; i++)
|
for (i = 0; i < DIR_COUNT ; i++)
|
||||||
if (R_EXIT(room, i))
|
if (R_EXIT(room, i))
|
||||||
doors++;
|
doors++;
|
||||||
|
|
||||||
|
|
@ -514,7 +514,7 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
|
||||||
*str = '\0';
|
*str = '\0';
|
||||||
} else {
|
} else {
|
||||||
for ( ; ; ) {
|
for ( ; ; ) {
|
||||||
doors = rand_number(0, NUM_OF_DIRS-1);
|
doors = rand_number(0, DIR_COUNT-1);
|
||||||
if (R_EXIT(room, doors))
|
if (R_EXIT(room, doors))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ WCMD(do_wasound)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (door = 0; door < NUM_OF_DIRS; door++) {
|
for (door = 0; door < DIR_COUNT; door++) {
|
||||||
struct room_direction_data *newexit;
|
struct room_direction_data *newexit;
|
||||||
|
|
||||||
if ((newexit = room->dir_option[door]) && (newexit->to_room != NOWHERE) &&
|
if ((newexit = room->dir_option[door]) && (newexit->to_room != NOWHERE) &&
|
||||||
|
|
|
||||||
|
|
@ -330,7 +330,7 @@ void death_cry(struct char_data *ch)
|
||||||
|
|
||||||
act("Your blood freezes as you hear $n's death cry.", FALSE, ch, 0, 0, TO_ROOM);
|
act("Your blood freezes as you hear $n's death cry.", FALSE, ch, 0, 0, TO_ROOM);
|
||||||
|
|
||||||
for (door = 0; door < NUM_OF_DIRS; door++)
|
for (door = 0; door < DIR_COUNT; door++)
|
||||||
if (CAN_GO(ch, door))
|
if (CAN_GO(ch, door))
|
||||||
send_to_room(world[IN_ROOM(ch)].dir_option[door]->to_room, "Your blood freezes as you hear someone's death cry.\r\n");
|
send_to_room(world[IN_ROOM(ch)].dir_option[door]->to_room, "Your blood freezes as you hear someone's death cry.\r\n");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -423,7 +423,7 @@ static int export_info_file(zone_rnum zrnum)
|
||||||
|
|
||||||
room = &world[rnum];
|
room = &world[rnum];
|
||||||
|
|
||||||
for (j = 0; j < NUM_OF_DIRS; j++) {
|
for (j = 0; j < DIR_COUNT; j++) {
|
||||||
if (!R_EXIT(room, j))
|
if (!R_EXIT(room, j))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
@ -894,7 +894,7 @@ static int export_save_rooms(zone_rnum zrnum)
|
||||||
);
|
);
|
||||||
|
|
||||||
/* Now you write out the exits for the room. */
|
/* Now you write out the exits for the room. */
|
||||||
for (j = 0; j < NUM_OF_DIRS; j++) {
|
for (j = 0; j < DIR_COUNT; j++) {
|
||||||
if (R_EXIT(room, j)) {
|
if (R_EXIT(room, j)) {
|
||||||
int dflag;
|
int dflag;
|
||||||
if (R_EXIT(room, j)->general_description) {
|
if (R_EXIT(room, j)->general_description) {
|
||||||
|
|
|
||||||
13
src/genwld.c
13
src/genwld.c
|
|
@ -107,7 +107,7 @@ room_rnum add_room(struct room_data *room)
|
||||||
i = top_of_world + 1;
|
i = top_of_world + 1;
|
||||||
do {
|
do {
|
||||||
i--;
|
i--;
|
||||||
for (j = 0; j < NUM_OF_DIRS; j++)
|
for (j = 0; j < DIR_COUNT; j++)
|
||||||
if (W_EXIT(i, j) && W_EXIT(i, j)->to_room != NOWHERE)
|
if (W_EXIT(i, j) && W_EXIT(i, j)->to_room != NOWHERE)
|
||||||
W_EXIT(i, j)->to_room += (W_EXIT(i, j)->to_room >= found);
|
W_EXIT(i, j)->to_room += (W_EXIT(i, j)->to_room >= found);
|
||||||
} while (i > 0);
|
} while (i > 0);
|
||||||
|
|
@ -172,7 +172,7 @@ int delete_room(room_rnum rnum)
|
||||||
i = top_of_world + 1;
|
i = top_of_world + 1;
|
||||||
do {
|
do {
|
||||||
i--;
|
i--;
|
||||||
for (j = 0; j < NUM_OF_DIRS; j++) {
|
for (j = 0; j < NUM_OF_DIRS; j++) { /* NUM_OF_DIRS, not DIR_COUNT */
|
||||||
if (W_EXIT(i, j) == NULL)
|
if (W_EXIT(i, j) == NULL)
|
||||||
continue;
|
continue;
|
||||||
else if (W_EXIT(i, j)->to_room > rnum)
|
else if (W_EXIT(i, j)->to_room > rnum)
|
||||||
|
|
@ -301,7 +301,7 @@ int save_rooms(zone_rnum rzone)
|
||||||
);
|
);
|
||||||
|
|
||||||
/* Now you write out the exits for the room. */
|
/* Now you write out the exits for the room. */
|
||||||
for (j = 0; j < NUM_OF_DIRS; j++) {
|
for (j = 0; j < DIR_COUNT; j++) {
|
||||||
if (R_EXIT(room, j)) {
|
if (R_EXIT(room, j)) {
|
||||||
int dflag;
|
int dflag;
|
||||||
if (R_EXIT(room, j)->general_description) {
|
if (R_EXIT(room, j)->general_description) {
|
||||||
|
|
@ -316,6 +316,9 @@ int save_rooms(zone_rnum rzone)
|
||||||
dflag = 2;
|
dflag = 2;
|
||||||
else
|
else
|
||||||
dflag = 1;
|
dflag = 1;
|
||||||
|
|
||||||
|
if (IS_SET(R_EXIT(room, j)->exit_info, EX_HIDDEN))
|
||||||
|
dflag += 2;
|
||||||
} else
|
} else
|
||||||
dflag = 0;
|
dflag = 0;
|
||||||
|
|
||||||
|
|
@ -395,7 +398,7 @@ int copy_room_strings(struct room_data *dest, struct room_data *source)
|
||||||
dest->description = str_udup(source->description);
|
dest->description = str_udup(source->description);
|
||||||
dest->name = str_udup(source->name);
|
dest->name = str_udup(source->name);
|
||||||
|
|
||||||
for (i = 0; i < NUM_OF_DIRS; i++) {
|
for (i = 0; i < DIR_COUNT; i++) {
|
||||||
if (!R_EXIT(source, i))
|
if (!R_EXIT(source, i))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
@ -426,7 +429,7 @@ int free_room_strings(struct room_data *room)
|
||||||
free_ex_descriptions(room->ex_description);
|
free_ex_descriptions(room->ex_description);
|
||||||
|
|
||||||
/* Free exits. */
|
/* Free exits. */
|
||||||
for (i = 0; i < NUM_OF_DIRS; i++) {
|
for (i = 0; i < NUM_OF_DIRS; i++) { /* NUM_OF_DIRS, not DIR_COUNT */
|
||||||
if (room->dir_option[i]) {
|
if (room->dir_option[i]) {
|
||||||
if (room->dir_option[i]->general_description)
|
if (room->dir_option[i]->general_description)
|
||||||
free(room->dir_option[i]->general_description);
|
free(room->dir_option[i]->general_description);
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ static int find_first_step(room_rnum src, room_rnum target)
|
||||||
MARK(src);
|
MARK(src);
|
||||||
|
|
||||||
/* first, enqueue the first steps, saving which direction we're going. */
|
/* first, enqueue the first steps, saving which direction we're going. */
|
||||||
for (curr_dir = 0; curr_dir < NUM_OF_DIRS; curr_dir++)
|
for (curr_dir = 0; curr_dir < DIR_COUNT; curr_dir++)
|
||||||
if (VALID_EDGE(src, curr_dir)) {
|
if (VALID_EDGE(src, curr_dir)) {
|
||||||
MARK(TOROOM(src, curr_dir));
|
MARK(TOROOM(src, curr_dir));
|
||||||
bfs_enqueue(TOROOM(src, curr_dir), curr_dir);
|
bfs_enqueue(TOROOM(src, curr_dir), curr_dir);
|
||||||
|
|
@ -125,7 +125,7 @@ static int find_first_step(room_rnum src, room_rnum target)
|
||||||
bfs_clear_queue();
|
bfs_clear_queue();
|
||||||
return (curr_dir);
|
return (curr_dir);
|
||||||
} else {
|
} else {
|
||||||
for (curr_dir = 0; curr_dir < NUM_OF_DIRS; curr_dir++)
|
for (curr_dir = 0; curr_dir < DIR_COUNT; curr_dir++)
|
||||||
if (VALID_EDGE(queue_head->room, curr_dir)) {
|
if (VALID_EDGE(queue_head->room, curr_dir)) {
|
||||||
MARK(TOROOM(queue_head->room, curr_dir));
|
MARK(TOROOM(queue_head->room, curr_dir));
|
||||||
bfs_enqueue(TOROOM(queue_head->room, curr_dir), queue_head->dir);
|
bfs_enqueue(TOROOM(queue_head->room, curr_dir), queue_head->dir);
|
||||||
|
|
@ -170,7 +170,7 @@ ACMD(do_track)
|
||||||
int tries = 10;
|
int tries = 10;
|
||||||
/* Find a random direction. :) */
|
/* Find a random direction. :) */
|
||||||
do {
|
do {
|
||||||
dir = rand_number(0, NUM_OF_DIRS - 1);
|
dir = rand_number(0, DIR_COUNT - 1);
|
||||||
} while (!CAN_GO(ch, dir) && --tries);
|
} while (!CAN_GO(ch, dir) && --tries);
|
||||||
send_to_char(ch, "You sense a trail %s from here!\r\n", dirs[dir]);
|
send_to_char(ch, "You sense a trail %s from here!\r\n", dirs[dir]);
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -261,7 +261,7 @@ void House_boot(void)
|
||||||
if ((real_atrium = real_room(temp_house.atrium)) == NOWHERE)
|
if ((real_atrium = real_room(temp_house.atrium)) == NOWHERE)
|
||||||
continue; /* house doesn't have an atrium -- skip */
|
continue; /* house doesn't have an atrium -- skip */
|
||||||
|
|
||||||
if (temp_house.exit_num < 0 || temp_house.exit_num >= NUM_OF_DIRS)
|
if (temp_house.exit_num < 0 || temp_house.exit_num >= DIR_COUNT)
|
||||||
continue; /* invalid exit num -- skip */
|
continue; /* invalid exit num -- skip */
|
||||||
|
|
||||||
if (TOROOM(real_house, temp_house.exit_num) != real_atrium)
|
if (TOROOM(real_house, temp_house.exit_num) != real_atrium)
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,14 @@ cpp_extern const struct command_info cmd_info[] = {
|
||||||
{ "west" , "w" , POS_STANDING, do_move , 0, ADMLVL_MORTAL, ADM_NONE, SCMD_WEST },
|
{ "west" , "w" , POS_STANDING, do_move , 0, ADMLVL_MORTAL, ADM_NONE, SCMD_WEST },
|
||||||
{ "up" , "u" , POS_STANDING, do_move , 0, ADMLVL_MORTAL, ADM_NONE, SCMD_UP },
|
{ "up" , "u" , POS_STANDING, do_move , 0, ADMLVL_MORTAL, ADM_NONE, SCMD_UP },
|
||||||
{ "down" , "d" , POS_STANDING, do_move , 0, ADMLVL_MORTAL, ADM_NONE, SCMD_DOWN },
|
{ "down" , "d" , POS_STANDING, do_move , 0, ADMLVL_MORTAL, ADM_NONE, SCMD_DOWN },
|
||||||
|
{ "northwest", "northw" , POS_STANDING, do_move , 0, ADMLVL_MORTAL, ADM_NONE, SCMD_NW },
|
||||||
|
{ "nw" , "nw" , POS_STANDING, do_move , 0, ADMLVL_MORTAL, ADM_NONE, SCMD_NW },
|
||||||
|
{ "northeast", "northe" , POS_STANDING, do_move , 0, ADMLVL_MORTAL, ADM_NONE, SCMD_NE },
|
||||||
|
{ "ne" , "ne" , POS_STANDING, do_move , 0, ADMLVL_MORTAL, ADM_NONE, SCMD_NE },
|
||||||
|
{ "southeast", "southe" , POS_STANDING, do_move , 0, ADMLVL_MORTAL, ADM_NONE, SCMD_SE },
|
||||||
|
{ "se" , "se" , POS_STANDING, do_move , 0, ADMLVL_MORTAL, ADM_NONE, SCMD_SE },
|
||||||
|
{ "southwest", "southw" , POS_STANDING, do_move , 0, ADMLVL_MORTAL, ADM_NONE, SCMD_SW },
|
||||||
|
{ "sw" , "sw" , POS_STANDING, do_move , 0, ADMLVL_MORTAL, ADM_NONE, SCMD_SW },
|
||||||
|
|
||||||
/* now, the main list */
|
/* now, the main list */
|
||||||
{ "at" , "at" , POS_DEAD , do_at , 0, ADMLVL_IMMORT, ADM_NONE, 0 },
|
{ "at" , "at" , POS_DEAD , do_at , 0, ADMLVL_IMMORT, ADM_NONE, 0 },
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,10 @@ struct alias_data {
|
||||||
#define SCMD_WEST WEST
|
#define SCMD_WEST WEST
|
||||||
#define SCMD_UP UP
|
#define SCMD_UP UP
|
||||||
#define SCMD_DOWN DOWN
|
#define SCMD_DOWN DOWN
|
||||||
|
#define SCMD_NW NORTHWEST
|
||||||
|
#define SCMD_NE NORTHEAST
|
||||||
|
#define SCMD_SE SOUTHEAST
|
||||||
|
#define SCMD_SW SOUTHWEST
|
||||||
|
|
||||||
/** @deprecated all old do_poof stuff is deprecated and unused. */
|
/** @deprecated all old do_poof stuff is deprecated and unused. */
|
||||||
#define SCMD_POOFIN 0
|
#define SCMD_POOFIN 0
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ void mobile_activity(void)
|
||||||
|
|
||||||
/* Mob Movement */
|
/* Mob Movement */
|
||||||
if (!MOB_FLAGGED(ch, MOB_SENTINEL) && (GET_POS(ch) == POS_STANDING) &&
|
if (!MOB_FLAGGED(ch, MOB_SENTINEL) && (GET_POS(ch) == POS_STANDING) &&
|
||||||
((door = rand_number(0, 18)) < NUM_OF_DIRS) && CAN_GO(ch, door) &&
|
((door = rand_number(0, 18)) < DIR_COUNT) && CAN_GO(ch, door) &&
|
||||||
!ROOM_FLAGGED(EXIT(ch, door)->to_room, ROOM_NOMOB) &&
|
!ROOM_FLAGGED(EXIT(ch, door)->to_room, ROOM_NOMOB) &&
|
||||||
!ROOM_FLAGGED(EXIT(ch, door)->to_room, ROOM_DEATH) &&
|
!ROOM_FLAGGED(EXIT(ch, door)->to_room, ROOM_DEATH) &&
|
||||||
(!MOB_FLAGGED(ch, MOB_STAY_ZONE) ||
|
(!MOB_FLAGGED(ch, MOB_STAY_ZONE) ||
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ int free_strings(void *data, int type)
|
||||||
case OASIS_EXI:
|
case OASIS_EXI:
|
||||||
room = (struct room_data *) data;
|
room = (struct room_data *) data;
|
||||||
|
|
||||||
for (i = 0; i < NUM_OF_DIRS; i++) {
|
for (i = 0; i < NUM_OF_DIRS; i++) { /* NUM_OF_DIRS, not DIR_COUNT */
|
||||||
if (room->dir_option[i]) {
|
if (room->dir_option[i]) {
|
||||||
if (room->dir_option[i]->general_description) {
|
if (room->dir_option[i]->general_description) {
|
||||||
free(room->dir_option[i]->general_description);
|
free(room->dir_option[i]->general_description);
|
||||||
|
|
|
||||||
|
|
@ -209,7 +209,7 @@ ACMD(do_oasis_links)
|
||||||
send_to_char(ch, "Zone %d is linked to the following zones:\r\n", zvnum);
|
send_to_char(ch, "Zone %d is linked to the following zones:\r\n", zvnum);
|
||||||
for (nr = 0; nr <= top_of_world && (GET_ROOM_VNUM(nr) <= last); nr++) {
|
for (nr = 0; nr <= top_of_world && (GET_ROOM_VNUM(nr) <= last); nr++) {
|
||||||
if (GET_ROOM_VNUM(nr) >= first) {
|
if (GET_ROOM_VNUM(nr) >= first) {
|
||||||
for (j = 0; j < NUM_OF_DIRS; j++) {
|
for (j = 0; j < DIR_COUNT; j++) {
|
||||||
if (world[nr].dir_option[j]) {
|
if (world[nr].dir_option[j]) {
|
||||||
to_room = world[nr].dir_option[j]->to_room;
|
to_room = world[nr].dir_option[j]->to_room;
|
||||||
if (to_room != NOWHERE && (zrnum != world[to_room].zone))
|
if (to_room != NOWHERE && (zrnum != world[to_room].zone))
|
||||||
|
|
@ -259,7 +259,7 @@ static void list_rooms(struct char_data *ch, zone_rnum rnum, room_vnum vmin, roo
|
||||||
world[i].proto_script ? "[TRIG] " : ""
|
world[i].proto_script ? "[TRIG] " : ""
|
||||||
);
|
);
|
||||||
|
|
||||||
for (j = 0; j < NUM_OF_DIRS; j++) {
|
for (j = 0; j < DIR_COUNT; j++) {
|
||||||
if (W_EXIT(i, j) == NULL)
|
if (W_EXIT(i, j) == NULL)
|
||||||
continue;
|
continue;
|
||||||
if (W_EXIT(i, j)->to_room == NOWHERE)
|
if (W_EXIT(i, j)->to_room == NOWHERE)
|
||||||
|
|
|
||||||
130
src/redit.c
130
src/redit.c
|
|
@ -182,7 +182,7 @@ void redit_setup_existing(struct descriptor_data *d, int real_num)
|
||||||
room->description = str_udup(world[real_num].description);
|
room->description = str_udup(world[real_num].description);
|
||||||
|
|
||||||
/* Exits - We allocate only if necessary. */
|
/* Exits - We allocate only if necessary. */
|
||||||
for (counter = 0; counter < NUM_OF_DIRS; counter++) {
|
for (counter = 0; counter < DIR_COUNT; counter++) {
|
||||||
if (world[real_num].dir_option[counter]) {
|
if (world[real_num].dir_option[counter]) {
|
||||||
CREATE(room->dir_option[counter], struct room_direction_data, 1);
|
CREATE(room->dir_option[counter], struct room_direction_data, 1);
|
||||||
|
|
||||||
|
|
@ -277,7 +277,7 @@ void redit_save_internally(struct descriptor_data *d)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (STATE(dsc) == CON_REDIT) {
|
} else if (STATE(dsc) == CON_REDIT) {
|
||||||
for (j = 0; j < NUM_OF_DIRS; j++)
|
for (j = 0; j < DIR_COUNT; j++)
|
||||||
if (OLC_ROOM(dsc)->dir_option[j])
|
if (OLC_ROOM(dsc)->dir_option[j])
|
||||||
if (OLC_ROOM(dsc)->dir_option[j]->to_room >= room_num)
|
if (OLC_ROOM(dsc)->dir_option[j]->to_room >= room_num)
|
||||||
OLC_ROOM(dsc)->dir_option[j]->to_room++;
|
OLC_ROOM(dsc)->dir_option[j]->to_room++;
|
||||||
|
|
@ -336,8 +336,12 @@ static void redit_disp_exit_menu(struct descriptor_data *d)
|
||||||
}
|
}
|
||||||
/* Weird door handling! */
|
/* Weird door handling! */
|
||||||
if (IS_SET(OLC_EXIT(d)->exit_info, EX_ISDOOR)) {
|
if (IS_SET(OLC_EXIT(d)->exit_info, EX_ISDOOR)) {
|
||||||
if (IS_SET(OLC_EXIT(d)->exit_info, EX_PICKPROOF))
|
if (IS_SET(OLC_EXIT(d)->exit_info, EX_PICKPROOF) && IS_SET(OLC_EXIT(d)->exit_info, EX_HIDDEN))
|
||||||
|
strncpy(door_buf, "Hidden Pickproof", sizeof(door_buf)-1);
|
||||||
|
else if (IS_SET(OLC_EXIT(d)->exit_info, EX_PICKPROOF))
|
||||||
strncpy(door_buf, "Pickproof", sizeof(door_buf)-1);
|
strncpy(door_buf, "Pickproof", sizeof(door_buf)-1);
|
||||||
|
else if (IS_SET(OLC_EXIT(d)->exit_info, EX_HIDDEN))
|
||||||
|
strncpy(door_buf, "Is a Hidden Door", sizeof(door_buf)-1);
|
||||||
else
|
else
|
||||||
strncpy(door_buf, "Is a door", sizeof(door_buf)-1);
|
strncpy(door_buf, "Is a door", sizeof(door_buf)-1);
|
||||||
} else
|
} else
|
||||||
|
|
@ -370,8 +374,10 @@ static void redit_disp_exit_flag_menu(struct descriptor_data *d)
|
||||||
get_char_colors(d->character);
|
get_char_colors(d->character);
|
||||||
write_to_output(d, "%s0%s) No door\r\n"
|
write_to_output(d, "%s0%s) No door\r\n"
|
||||||
"%s1%s) Closeable door\r\n"
|
"%s1%s) Closeable door\r\n"
|
||||||
"%s2%s) Pickproof\r\n"
|
"%s2%s) Pickproof Door\r\n"
|
||||||
"Enter choice : ", grn, nrm, grn, nrm, grn, nrm);
|
"%s3%s) Hidden Door\r\n"
|
||||||
|
"%s4%s) Hidden, Pickproof Door\r\n"
|
||||||
|
"Enter choice : ", grn, nrm, grn, nrm, grn, nrm, grn, nrm, grn, nrm);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* For room flags. */
|
/* For room flags. */
|
||||||
|
|
@ -416,26 +422,21 @@ static void redit_disp_menu(struct descriptor_data *d)
|
||||||
"%s1%s) Name : %s%s\r\n"
|
"%s1%s) Name : %s%s\r\n"
|
||||||
"%s2%s) Description :\r\n%s%s"
|
"%s2%s) Description :\r\n%s%s"
|
||||||
"%s3%s) Room flags : %s%s\r\n"
|
"%s3%s) Room flags : %s%s\r\n"
|
||||||
"%s4%s) Sector type : %s%s\r\n"
|
"%s4%s) Sector type : %s%s\r\n",
|
||||||
"%s5%s) Exit north : %s%d\r\n"
|
|
||||||
"%s6%s) Exit east : %s%d\r\n"
|
|
||||||
"%s7%s) Exit south : %s%d\r\n"
|
|
||||||
"%s8%s) Exit west : %s%d\r\n"
|
|
||||||
"%s9%s) Exit up : %s%d\r\n"
|
|
||||||
"%sA%s) Exit down : %s%d\r\n"
|
|
||||||
"%sB%s) Extra descriptions menu\r\n"
|
|
||||||
"%sS%s) Script : %s%s\r\n"
|
|
||||||
"%sW%s) Copy Room\r\n"
|
|
||||||
"%sX%s) Delete Room\r\n"
|
|
||||||
"%sQ%s) Quit\r\n"
|
|
||||||
"Enter choice : ",
|
|
||||||
|
|
||||||
cyn, OLC_NUM(d), nrm,
|
cyn, OLC_NUM(d), nrm,
|
||||||
cyn, zone_table[OLC_ZNUM(d)].number, nrm,
|
cyn, zone_table[OLC_ZNUM(d)].number, nrm,
|
||||||
grn, nrm, yel, room->name,
|
grn, nrm, yel, room->name,
|
||||||
grn, nrm, yel, room->description,
|
grn, nrm, yel, room->description,
|
||||||
grn, nrm, cyn, buf1,
|
grn, nrm, cyn, buf1,
|
||||||
grn, nrm, cyn, buf2,
|
grn, nrm, cyn, buf2);
|
||||||
|
|
||||||
|
if (!CONFIG_DIAGONAL_DIRS)
|
||||||
|
{
|
||||||
|
write_to_output(d,
|
||||||
|
"%s5%s) Exit north : %s%d\r\n"
|
||||||
|
"%s6%s) Exit east : %s%d\r\n"
|
||||||
|
"%s7%s) Exit south : %s%d\r\n"
|
||||||
|
"%s8%s) Exit west : %s%d\r\n",
|
||||||
grn, nrm, cyn,
|
grn, nrm, cyn,
|
||||||
room->dir_option[NORTH] && room->dir_option[NORTH]->to_room != NOWHERE ?
|
room->dir_option[NORTH] && room->dir_option[NORTH]->to_room != NOWHERE ?
|
||||||
world[room->dir_option[NORTH]->to_room].number : -1,
|
world[room->dir_option[NORTH]->to_room].number : -1,
|
||||||
|
|
@ -447,7 +448,48 @@ static void redit_disp_menu(struct descriptor_data *d)
|
||||||
world[room->dir_option[SOUTH]->to_room].number : -1,
|
world[room->dir_option[SOUTH]->to_room].number : -1,
|
||||||
grn, nrm, cyn,
|
grn, nrm, cyn,
|
||||||
room->dir_option[WEST] && room->dir_option[WEST]->to_room != NOWHERE ?
|
room->dir_option[WEST] && room->dir_option[WEST]->to_room != NOWHERE ?
|
||||||
world[room->dir_option[WEST]->to_room].number : -1,
|
world[room->dir_option[WEST]->to_room].number : -1);
|
||||||
|
} else {
|
||||||
|
write_to_output(d,
|
||||||
|
"%s5%s) Exit north : %s%d%s, %sB%s) Exit northwest : %s%d\r\n"
|
||||||
|
"%s6%s) Exit east : %s%d%s, %sC%s) Exit northeast : %s%d\r\n"
|
||||||
|
"%s7%s) Exit south : %s%d%s, %sD%s) Exit southeast : %s%d\r\n"
|
||||||
|
"%s8%s) Exit west : %s%d%s, %sE%s) Exit southwest : %s%d\r\n",
|
||||||
|
grn, nrm, cyn,
|
||||||
|
room->dir_option[NORTH] && room->dir_option[NORTH]->to_room != NOWHERE ?
|
||||||
|
world[room->dir_option[NORTH]->to_room].number : -1, nrm,
|
||||||
|
grn, nrm, cyn,
|
||||||
|
room->dir_option[NORTHWEST] && room->dir_option[NORTHWEST]->to_room != NOWHERE ?
|
||||||
|
world[room->dir_option[NORTHWEST]->to_room].number : -1,
|
||||||
|
grn, nrm, cyn,
|
||||||
|
room->dir_option[EAST] && room->dir_option[EAST]->to_room != NOWHERE ?
|
||||||
|
world[room->dir_option[EAST]->to_room].number : -1, nrm,
|
||||||
|
grn, nrm, cyn,
|
||||||
|
room->dir_option[NORTHEAST] && room->dir_option[NORTHEAST]->to_room != NOWHERE ?
|
||||||
|
world[room->dir_option[NORTHEAST]->to_room].number : -1,
|
||||||
|
grn, nrm, cyn,
|
||||||
|
room->dir_option[SOUTH] && room->dir_option[SOUTH]->to_room != NOWHERE ?
|
||||||
|
world[room->dir_option[SOUTH]->to_room].number : -1, nrm,
|
||||||
|
grn, nrm, cyn,
|
||||||
|
room->dir_option[SOUTHEAST] && room->dir_option[SOUTHEAST]->to_room != NOWHERE ?
|
||||||
|
world[room->dir_option[SOUTHEAST]->to_room].number : -1,
|
||||||
|
grn, nrm, cyn,
|
||||||
|
room->dir_option[WEST] && room->dir_option[WEST]->to_room != NOWHERE ?
|
||||||
|
world[room->dir_option[WEST]->to_room].number : -1, nrm,
|
||||||
|
grn, nrm, cyn,
|
||||||
|
room->dir_option[SOUTHWEST] && room->dir_option[SOUTHWEST]->to_room != NOWHERE ?
|
||||||
|
world[room->dir_option[SOUTHWEST]->to_room].number : -1
|
||||||
|
);
|
||||||
|
}
|
||||||
|
write_to_output(d,
|
||||||
|
"%s9%s) Exit up : %s%d\r\n"
|
||||||
|
"%sA%s) Exit down : %s%d\r\n"
|
||||||
|
"%sF%s) Extra descriptions menu\r\n"
|
||||||
|
"%sS%s) Script : %s%s\r\n"
|
||||||
|
"%sW%s) Copy Room\r\n"
|
||||||
|
"%sX%s) Delete Room\r\n"
|
||||||
|
"%sQ%s) Quit\r\n"
|
||||||
|
"Enter choice : ",
|
||||||
grn, nrm, cyn,
|
grn, nrm, cyn,
|
||||||
room->dir_option[UP] && room->dir_option[UP]->to_room != NOWHERE ?
|
room->dir_option[UP] && room->dir_option[UP]->to_room != NOWHERE ?
|
||||||
world[room->dir_option[UP]->to_room].number : -1,
|
world[room->dir_option[UP]->to_room].number : -1,
|
||||||
|
|
@ -559,6 +601,46 @@ void redit_parse(struct descriptor_data *d, char *arg)
|
||||||
break;
|
break;
|
||||||
case 'b':
|
case 'b':
|
||||||
case 'B':
|
case 'B':
|
||||||
|
if (CONFIG_DIAGONAL_DIRS) {
|
||||||
|
write_to_output(d, "Invalid choice!");
|
||||||
|
redit_disp_menu(d);
|
||||||
|
} else {
|
||||||
|
OLC_VAL(d) = NORTHWEST;
|
||||||
|
redit_disp_exit_menu(d);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'c':
|
||||||
|
case 'C':
|
||||||
|
if (CONFIG_DIAGONAL_DIRS) {
|
||||||
|
write_to_output(d, "Invalid choice!");
|
||||||
|
redit_disp_menu(d);
|
||||||
|
} else {
|
||||||
|
OLC_VAL(d) = NORTHEAST;
|
||||||
|
redit_disp_exit_menu(d);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'd':
|
||||||
|
case 'D':
|
||||||
|
if (CONFIG_DIAGONAL_DIRS) {
|
||||||
|
write_to_output(d, "Invalid choice!");
|
||||||
|
redit_disp_menu(d);
|
||||||
|
} else {
|
||||||
|
OLC_VAL(d) = SOUTHEAST;
|
||||||
|
redit_disp_exit_menu(d);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'e':
|
||||||
|
case 'E':
|
||||||
|
if (CONFIG_DIAGONAL_DIRS) {
|
||||||
|
write_to_output(d, "Invalid choice!");
|
||||||
|
redit_disp_menu(d);
|
||||||
|
} else {
|
||||||
|
OLC_VAL(d) = SOUTHWEST;
|
||||||
|
redit_disp_exit_menu(d);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'f':
|
||||||
|
case 'F':
|
||||||
/* If the extra description doesn't exist. */
|
/* If the extra description doesn't exist. */
|
||||||
if (!OLC_ROOM(d)->ex_description)
|
if (!OLC_ROOM(d)->ex_description)
|
||||||
CREATE(OLC_ROOM(d)->ex_description, struct extra_descr_data, 1);
|
CREATE(OLC_ROOM(d)->ex_description, struct extra_descr_data, 1);
|
||||||
|
|
@ -721,8 +803,10 @@ void redit_parse(struct descriptor_data *d, char *arg)
|
||||||
} else {
|
} else {
|
||||||
/* Doors are a bit idiotic, don't you think? :) -- I agree. -gg */
|
/* Doors are a bit idiotic, don't you think? :) -- I agree. -gg */
|
||||||
OLC_EXIT(d)->exit_info = (number == 0 ? 0 :
|
OLC_EXIT(d)->exit_info = (number == 0 ? 0 :
|
||||||
(number == 1 ? EX_ISDOOR :
|
(number == 1 ? EX_ISDOOR :
|
||||||
(number == 2 ? EX_ISDOOR | EX_PICKPROOF : 0)));
|
(number == 2 ? EX_ISDOOR | EX_PICKPROOF :
|
||||||
|
(number == 3 ? EX_ISDOOR | EX_HIDDEN :
|
||||||
|
(number == 4 ? EX_ISDOOR | EX_PICKPROOF | EX_HIDDEN : 0)))));
|
||||||
/* Jump back to the menu system. */
|
/* Jump back to the menu system. */
|
||||||
redit_disp_exit_menu(d);
|
redit_disp_exit_menu(d);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -433,8 +433,9 @@ SPECIAL(guild_guard)
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
|
|
||||||
/* find out what direction they are trying to go */
|
/* find out what direction they are trying to go */
|
||||||
for (direction = 0; direction < NUM_OF_DIRS; direction++)
|
for (direction = 0; direction < DIR_COUNT; direction++)
|
||||||
if (!strcmp(cmd_info[cmd].command, dirs[direction]))
|
if (!strcmp(cmd_info[cmd].command, dirs[direction]) ||
|
||||||
|
!strcmp(cmd_info[cmd].command, autoexits[direction]))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
for (i = 0; guild_info[i].guild_room != NOWHERE; i++) {
|
for (i = 0; guild_info[i].guild_room != NOWHERE; i++) {
|
||||||
|
|
|
||||||
|
|
@ -64,10 +64,14 @@
|
||||||
#define WEST 3 /**< The direction west */
|
#define WEST 3 /**< The direction west */
|
||||||
#define UP 4 /**< The direction up */
|
#define UP 4 /**< The direction up */
|
||||||
#define DOWN 5 /**< The direction down */
|
#define DOWN 5 /**< The direction down */
|
||||||
|
#define NORTHWEST 6 /**< The direction north-west */
|
||||||
|
#define NORTHEAST 7 /**< The direction north-east */
|
||||||
|
#define SOUTHEAST 8 /**< The direction south-east */
|
||||||
|
#define SOUTHWEST 9 /**< The direction south-west */
|
||||||
/** Total number of directions available to move in. BEFORE CHANGING THIS, make
|
/** Total number of directions available to move in. BEFORE CHANGING THIS, make
|
||||||
* sure you change every other direction and movement based item that this will
|
* sure you change every other direction and movement based item that this will
|
||||||
* impact. */
|
* impact. */
|
||||||
#define NUM_OF_DIRS 6
|
#define NUM_OF_DIRS 10
|
||||||
|
|
||||||
/* Room flags: used in room_data.room_flags */
|
/* Room flags: used in room_data.room_flags */
|
||||||
/* WARNING: In the world files, NEVER set the bits marked "R" ("Reserved") */
|
/* WARNING: In the world files, NEVER set the bits marked "R" ("Reserved") */
|
||||||
|
|
@ -102,11 +106,11 @@
|
||||||
#define NUM_ZONE_FLAGS 6
|
#define NUM_ZONE_FLAGS 6
|
||||||
|
|
||||||
/* Exit info: used in room_data.dir_option.exit_info */
|
/* Exit info: used in room_data.dir_option.exit_info */
|
||||||
#define EX_ISDOOR (1 << 0) /**< Exit is a door */
|
#define EX_ISDOOR (1 << 0) /**< Exit is a door */
|
||||||
#define EX_CLOSED (1 << 1) /**< The door is closed */
|
#define EX_CLOSED (1 << 1) /**< The door is closed */
|
||||||
#define EX_LOCKED (1 << 2) /**< The door is locked */
|
#define EX_LOCKED (1 << 2) /**< The door is locked */
|
||||||
#define EX_PICKPROOF (1 << 3) /**< Lock can't be picked */
|
#define EX_PICKPROOF (1 << 3) /**< Lock can't be picked */
|
||||||
#define EX_HIDDEN (1 << 4) /**< Exit is hidden */
|
#define EX_HIDDEN (1 << 4) /**< Exit is hidden, secret */
|
||||||
|
|
||||||
/* Sector types: used in room_data.sector_type */
|
/* Sector types: used in room_data.sector_type */
|
||||||
#define SECT_INSIDE 0 /**< Indoors, connected to SECT macro. */
|
#define SECT_INSIDE 0 /**< Indoors, connected to SECT macro. */
|
||||||
|
|
@ -1314,6 +1318,7 @@ struct game_data
|
||||||
int track_through_doors; /**< Track through doors while closed? */
|
int track_through_doors; /**< Track through doors while closed? */
|
||||||
int no_mort_to_immort; /**< Prevent mortals leveling to imms? */
|
int no_mort_to_immort; /**< Prevent mortals leveling to imms? */
|
||||||
int disp_closed_doors; /**< Display closed doors in autoexit? */
|
int disp_closed_doors; /**< Display closed doors in autoexit? */
|
||||||
|
int diagonal_dirs; /**< Are there 6 or 10 directions? */
|
||||||
int map_option; /**< MAP_ON, MAP_OFF or MAP_IMM_ONLY */
|
int map_option; /**< MAP_ON, MAP_OFF or MAP_IMM_ONLY */
|
||||||
int map_size; /**< Default size for map command */
|
int map_size; /**< Default size for map command */
|
||||||
int minimap_size; /**< Default size for mini-map (automap) */
|
int minimap_size; /**< Default size for mini-map (automap) */
|
||||||
|
|
|
||||||
|
|
@ -850,6 +850,13 @@ do \
|
||||||
(EXIT(ch,door)->to_room != NOWHERE) && \
|
(EXIT(ch,door)->to_room != NOWHERE) && \
|
||||||
!IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED))
|
!IS_SET(EXIT(ch, door)->exit_info, EX_CLOSED))
|
||||||
|
|
||||||
|
/** True total number of directions available to move in. */
|
||||||
|
#define DIR_COUNT ((CONFIG_DIAGONAL_DIRS) ? 10 : 6)
|
||||||
|
|
||||||
|
/* Returns TRUE if the direction is a diagonal one */
|
||||||
|
#define IS_DIAGONAL(dir) (((dir) == NORTHWEST) || ((dir) == NORTHEAST) || \
|
||||||
|
((dir) == SOUTHEAST) || ((dir) == SOUTHWEST) )
|
||||||
|
|
||||||
/** Return the class abbreviation for ch. */
|
/** Return the class abbreviation for ch. */
|
||||||
#define CLASS_ABBR(ch) (IS_NPC(ch) ? "--" : class_abbrevs[(int)GET_CLASS(ch)])
|
#define CLASS_ABBR(ch) (IS_NPC(ch) ? "--" : class_abbrevs[(int)GET_CLASS(ch)])
|
||||||
|
|
||||||
|
|
@ -977,6 +984,8 @@ do \
|
||||||
#define CONFIG_NOEFFECT config_info.play.NOEFFECT
|
#define CONFIG_NOEFFECT config_info.play.NOEFFECT
|
||||||
/** Get the display closed doors setting. */
|
/** Get the display closed doors setting. */
|
||||||
#define CONFIG_DISP_CLOSED_DOORS config_info.play.disp_closed_doors
|
#define CONFIG_DISP_CLOSED_DOORS config_info.play.disp_closed_doors
|
||||||
|
/** Get the diagonal directions setting. */
|
||||||
|
#define CONFIG_DIAGONAL_DIRS config_info.play.diagonal_dirs
|
||||||
|
|
||||||
/* Map/Automap options */
|
/* Map/Automap options */
|
||||||
#define CONFIG_MAP config_info.play.map_option
|
#define CONFIG_MAP config_info.play.map_option
|
||||||
|
|
|
||||||
|
|
@ -1055,7 +1055,7 @@ void zedit_parse(struct descriptor_data *d, char *arg)
|
||||||
case 'D':
|
case 'D':
|
||||||
pos = atoi(arg);
|
pos = atoi(arg);
|
||||||
/* Count directions. */
|
/* Count directions. */
|
||||||
if (pos < 0 || pos > NUM_OF_DIRS)
|
if (pos < 0 || pos > DIR_COUNT)
|
||||||
write_to_output(d, "Try again : ");
|
write_to_output(d, "Try again : ");
|
||||||
else {
|
else {
|
||||||
OLC_CMD(d).arg2 = pos;
|
OLC_CMD(d).arg2 = pos;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue