A slightly modified version:
> void look_in_direction(struct char_data *ch, room_rnum room, int dir)
> {
> /* Perhaps you want to sanity check the arguments too? */
> struct room_direction_data *rdata = world[room].dir_option[dir];
>
> if (rdata) {
- if (rdata->general_description)
- send_to_char(rdata->general_description, ch);
- else
- send_to_char("You see nothing special.\r\n", ch);
>
> if (EXIT_FLAGGED(rdata, EX_CLOSED) && rdata->keyword) {
> sprintf(buf, "The %s is closed.\r\n", fname(rdata->keyword));
> send_to_char(buf, ch);
- } else if (EXIT_FLAGGED(rdata, EX_ISDOOR) && rdata->keyword) {
+ } else {
+ if (rdata->general_description)
+ send_to_char(rdata->general_description, ch);
+ else
+ send_to_char("You see nothing special.\r\n", ch);
+ if (EXIT_FLAGGED(rdata, EX_ISDOOR) && rdata->keyword) {
> sprintf(buf, "The %s is open.\r\n", fname(rdata->keyword));
> send_to_char(buf, ch);
+ }
> }
> } else
> send_to_char("Nothing special there...\r\n", ch);
> }
This one doesn't let you look in the specified direction if the door is
closed.
Mike
--
+---------------------------------------------------------------+
| FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
| Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
| Newbie List: http://groups.yahoo.com/group/circle-newbies/ |
+---------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 06/25/03 PDT