# Patch name: nameswap # Patch version: 1.0 # Author's name: Nathan Baum (Luke@M*U*S*H) # Author's email: nathan_baum@btinternet.com # Version of PennMUSH: 1.7.7p18 # Date patch made: 24 August 2003 # Author is willing to support (yes/no): yes # # Patch format: Context # # 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. # This patch allows a player with name 'Foo' and alias 'Bar' to enter # '@name me=Bar' and have their name and alias automagically swapped around. *** src/set.c.orig Wed Aug 20 07:10:04 2003 --- src/set.c Sun Aug 24 20:57:16 2003 *************** *** 121,131 **** password++; } } if (strcasecmp(newname, Name(thing)) && !ok_player_name(newname)) { ! /* strcasecmp allows changing foo to Foo, etc. */ notify(player, T("You can't give a player that name.")); return; } /* everything ok, notify */ do_log(LT_CONN, 0, 0, T("Name change by %s(#%d) to %s"), --- 121,139 ---- password++; } } + /* strcasecmp allows changing foo to Foo, etc. */ if (strcasecmp(newname, Name(thing)) && !ok_player_name(newname)) { ! ATTR *a; ! if (a = atr_get_noparent(thing, "ALIAS")) ! if (!strcasecmp(newname, atr_value(a))) { ! notify(player, T("Swapping your name with your alias.")); ! atr_add(thing, "ALIAS", Name(thing), player, 0); ! goto hideous_do_name_label; ! } notify(player, T("You can't give a player that name.")); return; + hideous_do_name_label:; } /* everything ok, notify */ do_log(LT_CONN, 0, 0, T("Name change by %s(#%d) to %s"),