# # Patch name: show_zone_in_room_unparse.diff # Patch version: 1 # Author's name: Kurt Fitzner # Author's email: kfitzner@nexus.v-wave.com # Version of PennMUSH: 1.7.2p22 # Date patch made: Wed Mar 17 22:12:33 1999 # Author is willing to support (yes/no): yes # Patch format: diff -u5 # # # This is a contributed PennMUSH patch. Its use is subject to the # same restrictions found in PennMUSH's hdrs/copyrite.h file. # # No warranty is given for this patch. It is not necessarily going # to work on your system, with any version of PennMUSH other than # the one above, etc. # # If the author given above was willing to support the patch, you # should write to the author if you have any questions or problems. Do # *NOT* send email messages to Javelin or any PennMUSH mailing list about # this patch! # # Below this line is the author's description of the patch, # followed by the patch itself. If the patch is in context diff # format, you'll probably apply it by typing: patch < patchfile # in your top-level MUSH directory, unless instructed otherwise # below. # # show_zone_in_room_unparse.diff # A quick and dirty patch to add a colorized zone at the end # of a room name when displaying the room that you are 'look'ing # in (a la ATS Trekmush) # # This is similar to the showzone patch, except this patch does # not require you to set a flag on the room in order for it to # work. This is a little less flexible, but simpler. Plus, you # get a nice glaring red [Unzoned Room] to remind your builders # to zone things properly. # # Patch this from within the src directory. # --- /home/trek/tm/src/unparse.c Fri Apr 2 10:55:28 1999 +++ unparse.c Wed Mar 17 22:12:33 1999 @@ -68,10 +68,13 @@ dbref loc; int obey_myopic; { static char buf[BUFFER_LEN]; static char tbuf1[BUFFER_LEN]; + static char tbufz[BUFFER_LEN]; + + dbref zone; char *p; couldunparse = 0; if (!(GoodObject(loc) || (loc == NOTHING) || (loc == AMBIGUOUS) || (loc == HOME))) @@ -84,38 +87,60 @@ case HOME: return "*HOME*"; default: Access(loc); strcpy(tbuf1, Name(loc)); - if (IsExit(loc) && obey_myopic) { + if ((Typeof(loc) == TYPE_EXIT) && obey_myopic) { if ((p = strchr(tbuf1, ';'))) *p = '\0'; } + + tbufz[0] = 0; + if (Typeof(loc) == TYPE_ROOM) { + zone = Zone(loc); +#ifdef EXTENDED_ANSI + if (ANSI_NAMES && ShowAnsi(player)) { + if (GoodObject(zone)) { + sprintf(tbufz, " %s%s[%s%s%s]%s", ANSI_BLUE, ANSI_HILITE, ANSI_CYAN, + Name(zone), ANSI_BLUE, ANSI_NORMAL); + } else { + sprintf(tbufz, " %s%s[%sUNZONED ROOM%s]%s", ANSI_BLUE, ANSI_HILITE, + ANSI_RED, ANSI_BLUE, ANSI_NORMAL); + } + } else +#endif + sprintf(tbufz, " [%s]", ((GoodObject(zone))?Name(zone):"UNZONED ROOM")); + } + if ((Can_Examine(player, loc) || can_link_to(player, loc) || - JumpOk(loc) || ChownOk(loc) || DestOk(loc)) && + IS(loc, TYPE_ROOM, ROOM_JUMP_OK) || (Flags(loc) & CHOWN_OK) || + IS(loc, TYPE_THING, THING_DEST_OK)) && (!Myopic(player) || !obey_myopic)) { /* show everything */ if (SUPPORT_PUEBLO) couldunparse = 1; + + #ifdef EXTENDED_ANSI - if (ANSI_NAMES && ShowAnsi(player)) - sprintf(buf, "%s%s%s(#%d%s)", ANSI_HILITE, tbuf1, - ANSI_NORMAL, loc, unparse_flags(loc, player)); + if (ANSI_NAMES && ShowAnsi(player)) + sprintf(buf, "%s%s%s(#%d%s)%s", ANSI_HILITE, tbuf1, + ANSI_NORMAL, loc, unparse_flags(loc, player), tbufz); else #endif - sprintf(buf, "%s(#%d%s)", tbuf1, loc, - unparse_flags(loc, player)); + sprintf(buf, "%s(#%d%s)%s", tbuf1, loc, + unparse_flags(loc, player), tbufz); return buf; } else { /* show only the name */ #ifdef EXTENDED_ANSI if (ANSI_NAMES && ShowAnsi(player)) { - sprintf(buf, "%s%s%s", ANSI_HILITE, tbuf1, ANSI_NORMAL); + sprintf(buf, "%s%s%s%s", ANSI_HILITE, tbuf1, ANSI_NORMAL, tbufz); return buf; } else #endif - return tbuf1; + sprintf(buf, "%s%s", tbuf1, tbufz); + return buf; } } } static char boolexp_buf[BUFFER_LEN];