From 9df7eb49b00f4b91ae55d8a96067204389db60b5 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sat, 3 Mar 2018 19:56:16 +0100 Subject: [PATCH] Don't allow recog:ing a masked person --- evennia/contrib/rpsystem.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/evennia/contrib/rpsystem.py b/evennia/contrib/rpsystem.py index d469aff3d9..a56d2de731 100644 --- a/evennia/contrib/rpsystem.py +++ b/evennia/contrib/rpsystem.py @@ -708,12 +708,15 @@ class RecogHandler(object): than `max_length`. """ + if not obj.access(self.obj, "enable_recog", default=True): + raise SdescError("This person is unrecognizeable.") + # strip emote components from recog - recog = _RE_REF.sub(r"\1", - _RE_REF_LANG.sub(r"\1", - _RE_SELF_REF.sub(r"", - _RE_LANGUAGE.sub(r"", - _RE_OBJ_REF_START.sub(r"", recog))))) + recog = _RE_REF.sub( + r"\1", _RE_REF_LANG.sub( + r"\1", _RE_SELF_REF.sub( + r"", _RE_LANGUAGE.sub( + r"", _RE_OBJ_REF_START.sub(r"", recog))))) # make an recog clean of ANSI codes cleaned_recog = ansi.strip_ansi(recog)