# Patch name: inspect.172p20 # Patch version: 1 # Author's name: Sam Sargeant # Author's email: sam@whackass.com # version of PennMUSH: 1.7.2p20 # Date patch made: 20/01/1999 # Author is willing to support (yes/no): Yes # Patch Format: diff -c # # # This is a contributed PennMUSH patch. Its subject to the same # restrictions found in PennMUSH's hdrs/copyrite.h file. # # No warranty is given for this patch. It is not necassarily 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. # Various MUSHes have coded a INSPECT attribute system on their room parent. All INSPECT_* attributes are shown to the player as if they were objects in the room. Those rooms usually were set !no_command and the player had to use the softcoded 'inspect' command to view them. This patch modifies the behavior when a player looks at anything. It will check for the existance of an INSPECT_ attribute and, if it exists, evaluate that attribute and show it to the user. This feature is extremly useful for signs, maps and any other information that doesn't require another object just to display it. *** src/look.c Wed Jan 20 10:29:56 1999 --- src/look.c.inspect Wed Jan 20 10:26:29 1999 *************** *** 502,507 **** --- 502,518 ---- { dbref thing; dbref loc; + char buff[BUFFER_LEN], *bp; + char *inspect_name; + char const *sp; + ATTR *inspect_attrib; + + inspect_name = (char *) mush_malloc((sizeof(char) * BUFFER_LEN), "inspect_name") ; + + strcpy(inspect_name,"INSPECT_"); + strcat(inspect_name,name); if (!GoodObject(Location(player))) return; *************** *** 532,537 **** --- 543,562 ---- return; } } else { /* regular look */ + inspect_attrib = atr_get(Location(player),upcasestr(inspect_name)); + mush_free(inspect_name, "inspect_name"); + if (inspect_attrib) { + sp = safe_uncompress(inspect_attrib->value); + bp = buff; + process_expression(buff, &bp, &sp, Location(player), player, player, + PE_DEFAULT, PT_DEFAULT, NULL); + *bp = '\0'; + notify(player, tprintf("%s\n%s",upcasestr((char *) name), (char *) + &buff)); + return; + } if (*name == '\0') { look_room(player, Location(player), 0); return;