Some minor bugfixes.

This commit is contained in:
Griatch 2010-09-12 16:19:02 +00:00
parent 5361bd03d3
commit af89dd1ef7
2 changed files with 5 additions and 4 deletions

View file

@ -535,13 +535,14 @@ class CmdNewPassword(MuxCommand):
return return
# the player search also matches 'me' etc. # the player search also matches 'me' etc.
player = caller.search("*%s" % self.lhs, global_search=True) character = caller.search("*%s" % self.lhs, global_search=True)
if not player: if not character:
return return
player = character.player
player.user.set_password(self.rhs) player.user.set_password(self.rhs)
player.user.save() player.user.save()
caller.msg("%s - new password set to '%s'." % (player.name, self.rhs)) caller.msg("%s - new password set to '%s'." % (player.name, self.rhs))
if player != caller: if character != caller:
player.msg("%s has changed your password to '%s'." % (caller.name, self.rhs)) player.msg("%s has changed your password to '%s'." % (caller.name, self.rhs))
class CmdHome(MuxCommand): class CmdHome(MuxCommand):

View file

@ -279,7 +279,7 @@ class ObjectManager(TypedObjectManager):
if str(ostring).startswith("*"): if str(ostring).startswith("*"):
# Player search - try to find obj by its player's name # Player search - try to find obj by its player's name
player_string = ostring.lstrip("*") player_string = ostring.lstrip("*")
player_match = self.get_obj_with_player(player_string) player_match = self.get_object_with_player(player_string)
if player_match is not None: if player_match is not None:
return [player_match] return [player_match]