Fixed @perm to correctly handle *name and also to be more informative. This fixes Issue 450.
This commit is contained in:
parent
ea7e43c746
commit
6a1d645c75
1 changed files with 4 additions and 2 deletions
|
|
@ -469,6 +469,7 @@ class CmdPerm(MuxCommand):
|
||||||
return
|
return
|
||||||
|
|
||||||
playermode = 'player' in self.switches or lhs.startswith('*')
|
playermode = 'player' in self.switches or lhs.startswith('*')
|
||||||
|
lhs = lhs.lstrip("*")
|
||||||
|
|
||||||
if playermode:
|
if playermode:
|
||||||
obj = caller.search_player(lhs)
|
obj = caller.search_player(lhs)
|
||||||
|
|
@ -528,8 +529,9 @@ class CmdPerm(MuxCommand):
|
||||||
cstring += "\nPermission '%s' is already defined on %s." % (rhs, obj.name)
|
cstring += "\nPermission '%s' is already defined on %s." % (rhs, obj.name)
|
||||||
else:
|
else:
|
||||||
obj.permissions.add(perm)
|
obj.permissions.add(perm)
|
||||||
cstring += "\nPermission '%s' given to %s." % (rhs, obj.name)
|
plystring = "the Player" if playermode else "the Object/Character"
|
||||||
tstring += "\n%s gives you the permission '%s'." % (caller.name, rhs)
|
cstring += "\nPermission '%s' given to %s (%s)." % (rhs, obj.name, plystring)
|
||||||
|
tstring += "\n%s gives you (%s, %s) the permission '%s'." % (caller.name, obj.name, plystring, rhs)
|
||||||
caller.msg(cstring.strip())
|
caller.msg(cstring.strip())
|
||||||
if tstring:
|
if tstring:
|
||||||
obj.msg(tstring.strip())
|
obj.msg(tstring.strip())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue