Added a convenience property player.character that will return the (puppeted) Object if in MULTISESSION_MODE 0 or 1, all puppeted Objects for MULTISESSION_MODE=2. Note that this is not quite the same as the old player.character - it will only return a character if that character is actually puppeted (the old scheme returned it also if the Player was offline).

This commit is contained in:
Griatch 2013-04-09 22:44:05 +02:00
parent be2d0086a3
commit ea4c30a0b1
2 changed files with 14 additions and 2 deletions

View file

@ -187,8 +187,8 @@ class MuxCommandOOC(MuxCommand):
# caller is an Object/Character
self.character = self.caller
self.caller = self.caller.player
elif hasattr(self.caller, "character"):
elif utils.inherits_from(self.caller, "src.players.players.Player"):
# caller was already a Player
self.character = self.caller.get_character(sessid=self.sessid)
self.character = self.caller.get_puppet(self.sessid)
else:
self.character = None