From 143df2a7931ca620adc1b74d8257bc9eaed59468 Mon Sep 17 00:00:00 2001 From: Griatch Date: Tue, 12 Apr 2016 21:01:20 +0200 Subject: [PATCH] Clarified the error when trying to examine an object on which you have neither examine, nor view permissions. Resolves #954. --- evennia/commands/default/building.py | 1 + evennia/objects/objects.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/evennia/commands/default/building.py b/evennia/commands/default/building.py index 25bc95cbab..49353d89f2 100644 --- a/evennia/commands/default/building.py +++ b/evennia/commands/default/building.py @@ -2011,6 +2011,7 @@ class CmdExamine(ObjManipCommand): # we have given a specific target object for objdef in self.lhs_objattr: + obj = None obj_name = objdef['name'] obj_attrs = objdef['attrs'] diff --git a/evennia/objects/objects.py b/evennia/objects/objects.py index 107a428863..86d3ae8468 100644 --- a/evennia/objects/objects.py +++ b/evennia/objects/objects.py @@ -1344,7 +1344,10 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)): """ if not target.access(self, "view"): - return "Could not find '%s'." % target + try: + return "Could not view '%s'." % target.get_display_name(self) + except AttributeError: + return "Could not view '%s'." % target.key # the target's at_desc() method. target.at_desc(looker=self) return target.return_appearance(self)