示例#1
0
 def enter_env(self, new_env, enter_action=None):
     entry_msg = Broadcast(getattr(enter_action, 'entry_msg', self.entry_msg), self, silent=True)
     entry_msg.target = getattr(enter_action, 'from_name', None)
     new_env.entity_enters(self, enter_action, entry_msg)
     new_instance = getattr(self.env, 'instance', None)
     if self.instance != new_instance:
         if self.instance:
             self.instance.remove_entity(self)
             del self.instance_id
         if new_instance:
             new_instance.add_entity(self)
             self.instance_id = new_instance.instance_id
     if self.instance:
         self.instance_room_id = self.env.dbo_id
     elif self.env.dbo_id:
         self.room_id = self.env.dbo_id
     self.env.first_look(self)