@@ -443,14 +443,16 @@ 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)
|
||||||
@@ -461,19 +463,23 @@ ACMD(do_exits)
|
|||||||
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),
|
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);
|
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)
|
if (!len)
|
||||||
send_to_char(ch, " None.\r\n");
|
send_to_char(ch, " None.\r\n");
|
||||||
}
|
}
|
||||||
@@ -489,22 +495,28 @@ void look_at_room(struct char_data *ch, int ignore_brief)
|
|||||||
if (!ch->desc)
|
if (!ch->desc)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (IS_DARK(IN_ROOM(ch)) && !CAN_SEE_IN_DARK(ch)) {
|
if (IS_DARK(IN_ROOM(ch)) && !CAN_SEE_IN_DARK(ch))
|
||||||
|
{
|
||||||
send_to_char(ch, "It is pitch black...\r\n");
|
send_to_char(ch, "It is pitch black...\r\n");
|
||||||
return;
|
return;
|
||||||
} else if (AFF_FLAGGED(ch, AFF_BLIND) && GET_LEVEL(ch) < LVL_IMMORT) {
|
}
|
||||||
|
else if (AFF_FLAGGED(ch, AFF_BLIND) && GET_LEVEL(ch) < LVL_IMMORT)
|
||||||
|
{
|
||||||
send_to_char(ch, "You see nothing but infinite darkness...\r\n");
|
send_to_char(ch, "You see nothing but infinite darkness...\r\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
send_to_char(ch, "%s", CCCYN(ch, C_NRM));
|
send_to_char(ch, "%s", CCCYN(ch, C_NRM));
|
||||||
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_SHOWVNUMS)) {
|
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_SHOWVNUMS))
|
||||||
|
{
|
||||||
char buf[MAX_STRING_LENGTH];
|
char buf[MAX_STRING_LENGTH];
|
||||||
|
|
||||||
sprintbitarray(ROOM_FLAGS(IN_ROOM(ch)), room_bits, RF_ARRAY_MAX, buf);
|
sprintbitarray(ROOM_FLAGS(IN_ROOM(ch)), room_bits, RF_ARRAY_MAX, buf);
|
||||||
send_to_char(ch, "[%5d] ", GET_ROOM_VNUM(IN_ROOM(ch)));
|
send_to_char(ch, "[%5d] ", GET_ROOM_VNUM(IN_ROOM(ch)));
|
||||||
send_to_char(ch, "%s[ %s][ %s ]", world[IN_ROOM(ch)].name, buf, sector_types[world[IN_ROOM(ch)].sector_type]);
|
send_to_char(ch, "%s[ %s][ %s ]", world[IN_ROOM(ch)].name, buf, sector_types[world[IN_ROOM(ch)].sector_type]);
|
||||||
|
|
||||||
if (SCRIPT(rm)) {
|
if (SCRIPT(rm))
|
||||||
|
{
|
||||||
send_to_char(ch, "[T");
|
send_to_char(ch, "[T");
|
||||||
for (t = TRIGGERS(SCRIPT(rm)); t; t = t->next)
|
for (t = TRIGGERS(SCRIPT(rm)); t; t = t->next)
|
||||||
send_to_char(ch, " %d", GET_TRIG_VNUM(t));
|
send_to_char(ch, " %d", GET_TRIG_VNUM(t));
|
||||||
@@ -512,14 +524,20 @@ void look_at_room(struct char_data *ch, int ignore_brief)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
send_to_char(ch, "%s", world[IN_ROOM(ch)].name);
|
send_to_char(ch, "%s", world[IN_ROOM(ch)].name);
|
||||||
send_to_char(ch, "%s\r\n", CCNRM(ch, C_NRM));
|
}
|
||||||
|
|
||||||
|
send_to_char(ch, "%s\r\n", CCCYN(ch, C_NRM));
|
||||||
|
|
||||||
if ((!IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_BRIEF)) || ignore_brief ||
|
if ((!IS_NPC(ch) && !PRF_FLAGGED(ch, PRF_BRIEF)) || ignore_brief ||
|
||||||
ROOM_FLAGGED(IN_ROOM(ch), ROOM_DEATH)) {
|
ROOM_FLAGGED(IN_ROOM(ch), ROOM_DEATH))
|
||||||
|
{
|
||||||
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOMAP) && can_see_map(ch))
|
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AUTOMAP) && can_see_map(ch))
|
||||||
str_and_map(world[target_room].description, ch, target_room);
|
str_and_map(world[target_room].description, ch, target_room);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
send_to_char(ch, "%s", world[IN_ROOM(ch)].description);
|
send_to_char(ch, "%s", world[IN_ROOM(ch)].description);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -671,13 +671,21 @@ struct char_data *get_char_num(mob_rnum nr)
|
|||||||
/* put an object in a room */
|
/* put an object in a room */
|
||||||
void obj_to_room(struct obj_data *object, room_rnum room)
|
void obj_to_room(struct obj_data *object, room_rnum room)
|
||||||
{
|
{
|
||||||
if (!object || room == NOWHERE || room > top_of_world)
|
if (!object || room == NOWHERE || room > top_of_world){
|
||||||
log("SYSERR: Illegal value(s) passed to obj_to_room. (Room #%d/%d, obj %p)",
|
log("SYSERR: Illegal value(s) passed to obj_to_room. (Room #%d/%d, obj %p)",
|
||||||
room, top_of_world, (void *)object);
|
room, top_of_world, (void *)object);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
object->next_content = world[room].contents;
|
if (world[room].contents == NULL){ // if list is empty
|
||||||
world[room].contents = object;
|
world[room].contents = object; // add object to list
|
||||||
IN_ROOM(object) = room;
|
}
|
||||||
|
else {
|
||||||
|
struct obj_data *i = world[room].contents; // define a temporary pointer
|
||||||
|
while (i->next_content != NULL) i = i->next_content; // find the first without a next_content
|
||||||
|
i->next_content = object; // add object at the end
|
||||||
|
}
|
||||||
|
object->next_content = NULL; // mostly for sanity. should do nothing.
|
||||||
|
IN_ROOM(object) = room
|
||||||
object->carried_by = NULL;
|
object->carried_by = NULL;
|
||||||
if (ROOM_FLAGGED(room, ROOM_HOUSE))
|
if (ROOM_FLAGGED(room, ROOM_HOUSE))
|
||||||
SET_BIT_AR(ROOM_FLAGS(room), ROOM_HOUSE_CRASH);
|
SET_BIT_AR(ROOM_FLAGS(room), ROOM_HOUSE_CRASH);
|
||||||
|
|||||||
Reference in New Issue
Block a user