View/Edit #12:remove_feature

Switch to edit mode.

Name(s): remove_feature
1:  "Remove a feature from this player's features list."
2:  "Need to have permissions on this or the feature."
3:  "Returns true if successful, E_PERM if caller didn't have permission."
4:  feature = args[1]
5:  "So, owners of Generic FO classes can remove your features arbitrarily.  In exchange, #3100 can rmfeature itself."
6:  if ($perm_utils:can_hack() || caller == feature || caller_perms() == feature.owner || caller_perms() == parent(feature).owner)
7:    if (typeof(this.features) == $LIST)
8:      "If this is a list, we can just setremove..."
9:      this.features = setremove(this.features, feature)
10:     "Otherwise, we leave it alone."
11:   endif
12:   "Let the feature know it's been removed."
13:   if (`feature:has_callable_verb("feature_remove") ! ANY')
14:     feature:feature_remove(this)
15:   endif
16:   return 1
17:   "We're done."
18: else
19:   raise(E_PERM)
20:   "Caller didn't have permission."
21: endif
22: "Last modified by Dax (#789) on Tue May  3 13:45:01 2005 MDT."

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: Slacker (#55)

You are not logged in.

[home | help | who | search | setup | code]