Vatiken, thank you for your comment.
I read your comments and recognized that there was a problem.
Code:
static void look_in_direction(struct char_data *ch, int dir)
{
if (EXIT(ch, dir)) {
if (EXIT(ch, dir)->general_description)
send_to_char(ch, "%s", EXIT(ch, dir)->general_description);
else
send_to_char(ch, "You see nothing special.\r\n");
if (EXIT_FLAGGED(EXIT(ch, dir), EX_CLOSED) && EXIT(ch, dir)->keyword)
send_to_char(ch, "The %s is closed.\r\n", fname(EXIT(ch, dir)->keyword));
else if (EXIT_FLAGGED(EXIT(ch, dir), EX_ISDOOR) && EXIT(ch, dir)->keyword)
send_to_char(ch, "The %s is open.\r\n", fname(EXIT(ch, dir)->keyword));
} else
send_to_char(ch, "Nothing special there...\r\n");
}
I revised the look_at_room code a little bit.
I am modifying the look_at_room code to display the information of the room that I am currently in, but the information of the room in the direction I want to see.
Code:
static void look_in_direction(struct char_data *ch, int dir)
{
if (EXIT(ch, dir)) {
int i, title_width = 30;
char buf[MAX_STRING_LENGTH];
if (!ch->desc)
return;
trig_data *t;
room_rnum scanned_room = IN_ROOM(ch);
scanned_room = world[scanned_room].dir_option[dir]->to_room;
struct room_data *rm = &world[scanned_room];
if (IS_DARK(scanned_room) && !CAN_SEE_IN_DARK(ch)) {
send_to_char(ch, "It is pitch black...\r\n");
return;
} else if (AFF_FLAGGED(ch, AFF_BLIND) && GET_LEVEL(ch) < LVL_IMMORT) {
send_to_char(ch, "You see nothing but infinite darkness...\r\n");
return;
}
send_to_char(ch, "\r\n\r\n%s", CCWHT(ch, C_SPR));
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_SHOWVNUMS)) {
title_width = strlen(world[scanned_room].name) / 2;
sprintbitarray(ROOM_FLAGS(scanned_room), room_bits, RF_ARRAY_MAX, buf);
send_to_char(ch, "%s[%s%5d%s] ", CBBLK(ch, C_SPR), CCYEL(ch, C_SPR), GET_ROOM_VNUM(scanned_room), CBBLK(ch, C_SPR));
send_to_char(ch, "%s%s %s[%s %s%s]%s",CCGRN(ch, C_SPR), world[scanned_room].name,
CBBLK(ch, C_SPR), CCCYN(ch, C_SPR), buf, CBBLK(ch, C_SPR), CCWHT(ch, C_SPR));
if (SCRIPT(rm)) {
send_to_char(ch, "%s[%sT%s",CBBLK(ch, C_SPR), CCMAG(ch, C_SPR), CBMAG(ch, C_SPR));
for (t = TRIGGERS(SCRIPT(rm)); t; t = t->next)
send_to_char(ch, " %d", GET_TRIG_VNUM(t));
send_to_char(ch, "%s]%s",CBBLK(ch, C_SPR),CCWHT(ch, C_SPR));
}
}
else {
if (!PRF_FLAGGED(ch, PRF_BRIEF)) { /* 간략모드 */
for (i = 0; i < (title_width - ((int)strlen(world[scanned_room].name) / 2)); i++) send_to_char(ch, " ");
send_to_char(ch, "%s--=oOo< %s %s%s", CCGRN(ch, C_SPR),
world[scanned_room].name, ">oOo=--\r\n", CCWHT(ch, C_SPR)); /* 방 제목 */
}
else send_to_char(ch, "%s[ %s%s %s]\r\n", CCWHT(ch, C_SPR),
CCGRN(ch, C_SPR), world[scanned_room].name, CCWHT(ch, C_SPR)); /* 방 제목 */
}
/* 빈줄숨김 */
if (!PRF_FLAGGED(ch, PRF_COMPACT)) {
send_to_char(ch, "\r\n");
}
if (!PRF_FLAGGED(ch, PRF_COMPACT) && PRF_FLAGGED(ch, PRF_SHOWVNUMS)) {
send_to_char(ch, "\r\n");
}
if ((!IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_BRIEF)) || ROOM_FLAGGED(scanned_room, ROOM_DEATH)) {
if(!IS_NPC(ch))
send_to_char(ch, "%s", world[scanned_room].description);
}
/* autoexits */
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOEXIT))
do_auto_exits(ch);
/* now list characters & objects */
list_obj_to_char(world[scanned_room].contents, ch, SHOW_OBJ_LONG, FALSE);
list_char_in_room(world[scanned_room].people, ch, 0, FALSE);
} else
send_to_char(ch, "Nothing special there...\r\n");
}
I am not familiar with programming yet, so I can modify the code a little like this.
With this modification, it seems that the monster and I do not have to fight the monster.
Thanks again for pointing out the problem in the code I wrote.