Original report:
--- 8< --- 8< ---
From: Alex <3raf7@qlink.queensu.ca>
Dunno if this carries through to pl8, but even if you are in the pitch
black (ie.. in the dark w/o a light), and you type 'where', you can see
the room's title.
--- 8< --- 8< ---
Easily fixed by not allowing a 'where' on yourself.
Also took the opportunity to make the code look better.
diff -upr stk/act.informative.c 150/act.informative.c
--- stk/act.informative.c Sat Jun 6 16:00:59 1998
+++ 150/act.informative.c Sat Jun 6 18:08:54 1998
@@ -1260,23 +1260,30 @@ void perform_mortal_where(struct char_da
if (!*arg) {
send_to_char("Players in your Zone\r\n--------------------\r\n", ch);
- for (d = descriptor_list; d; d = d->next)
- if (STATE(d) == CON_PLAYING) {
- i = (d->original ? d->original : d->character);
- if (i && CAN_SEE(ch, i) && (i->in_room != NOWHERE) &&
- (world[ch->in_room].zone == world[i->in_room].zone)) {
- sprintf(buf, "%-20s - %s\r\n", GET_NAME(i), world[i->in_room].name);
- send_to_char(buf, ch);
- }
- }
+ for (d = descriptor_list; d; d = d->next) {
+ if (STATE(d) != CON_PLAYING || d->character == ch)
+ continue;
+ if ((i = (d->original ? d->original : d->character)) == NULL)
+ continue;
+ if (i->in_room == NOWHERE || !CAN_SEE(ch, i))
+ continue;
+ if (world[ch->in_room].zone != world[i->in_room].zone)
+ continue;
+ sprintf(buf, "%-20s - %s\r\n", GET_NAME(i), world[i->in_room].name);
+ send_to_char(buf, ch);
+ }
} else { /* print only FIRST char, not all. */
- for (i = character_list; i; i = i->next)
- if (world[i->in_room].zone == world[ch->in_room].zone && CAN_SEE(ch, i) &&
- (i->in_room != NOWHERE) && isname(arg, i->player.name)) {
- sprintf(buf, "%-25s - %s\r\n", GET_NAME(i), world[i->in_room].name);
- send_to_char(buf, ch);
- return;
- }
+ for (i = character_list; i; i = i->next) {
+ if (i->in_room == NOWHERE || i == ch)
+ continue;
+ if (!CAN_SEE(ch, i) || world[i->in_room].zone != world[ch->in_room].zone)
+ continue;
+ if (!isname(arg, i->player.name))
+ continue;
+ sprintf(buf, "%-25s - %s\r\n", GET_NAME(i), world[i->in_room].name);
+ send_to_char(buf, ch);
+ return;
+ }
send_to_char("No-one around by that name.\r\n", ch);
}
}
--
George Greer, greerga@circlemud.org | Genius may have its limitations, but
http://patches.van.ml.org/ | stupidity is not thus handicapped.
http://www.van.ml.org/CircleMUD/ | -- Elbert Hubbard
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST