Fixed OOC display regression for non-superusers in MULTISESSION_MODEs 2,3. Also made the ic command able to correctly handle trying to puppet one of multiple same-named objects.

This commit is contained in:
Griatch 2016-08-06 20:52:01 +02:00
parent a740099d3f
commit 92f610470b
2 changed files with 8 additions and 7 deletions

View file

@ -216,12 +216,15 @@ class CmdIC(COMMAND_DEFAULT_CLASS):
return
if not new_character:
# search for a matching character
new_character = search.object_search(self.args)
if new_character:
new_character = new_character[0]
else:
new_character = [char for char in search.object_search(self.args) if char.access(player, "puppet")]
if not new_character:
self.msg("That is not a valid character choice.")
return
if len(new_character) > 1:
self.msg("Multiple characters with the same name:\n %s" % ", ".join(new_character))
return
else:
new_character = new_character[0]
try:
player.puppet_object(session, new_character)
player.db._last_puppet = new_character

View file

@ -815,11 +815,9 @@ class DefaultPlayer(with_metaclass(TypeclassBase, PlayerDB)):
if target and not is_iter(target):
# single target - just show it
return target.return_appearance(self)
elif not target:
return "|rNo such character.|n"
else:
# list of targets - make list to disconnect from db
characters = list(target)
characters = list(target) if target else []
sessions = self.sessions.all()
is_su = self.is_superuser