forked from kyonshi/grenzland-mud
Update act.informative.c
Fixes unguarded blocks of code in ACMD(do_exits) that could cause the server to report scripted trigger events (mob movements, exit links to rooms being reassigned, and doors being opened or closed) as script errors. Particularly, if this code is copy and pasted into the do_auto_exits().
This commit is contained in:
@@ -443,39 +443,44 @@ ACMD(do_exits)
|
|||||||
{
|
{
|
||||||
int door, len = 0;
|
int door, len = 0;
|
||||||
|
|
||||||
if (AFF_FLAGGED(ch, AFF_BLIND) && GET_LEVEL(ch) < LVL_IMMORT) {
|
if (AFF_FLAGGED(ch, AFF_BLIND) && GET_LEVEL(ch) < LVL_IMMORT)
|
||||||
|
{
|
||||||
send_to_char(ch, "You can't see a damned thing, you're blind!\r\n");
|
send_to_char(ch, "You can't see a damned thing, you're blind!\r\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
send_to_char(ch, "Obvious exits:\r\n");
|
send_to_char(ch, "Obvious exits:\r\n");
|
||||||
|
|
||||||
for (door = 0; door < DIR_COUNT; 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) && !PRF_FLAGGED(ch, PRF_HOLYLIGHT))
|
if (EXIT_FLAGGED(EXIT(ch, door), EX_HIDDEN) && !PRF_FLAGGED(ch, PRF_HOLYLIGHT))
|
||||||
continue;
|
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 %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);
|
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%s\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." : ".");
|
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) &&
|
||||||
!CAN_SEE_IN_DARK(ch) ? "Too dark to tell." : world[EXIT(ch, door)->to_room].name);
|
!CAN_SEE_IN_DARK(ch) ? "Too dark to tell." : world[EXIT(ch, door)->to_room].name);
|
||||||
|
}
|
||||||
|
if (!len)
|
||||||
|
send_to_char(ch, " None.\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!len)
|
|
||||||
send_to_char(ch, " None.\r\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void look_at_room(struct char_data *ch, int ignore_brief)
|
void look_at_room(struct char_data *ch, int ignore_brief)
|
||||||
|
|||||||
Reference in New Issue
Block a user