View/Edit #1:overb_conflicts

Switch to edit mode.

Name(s): overb_conflicts
1:  "Copied from Picard (#7153):verb_conflicts Aug 25 15:27:25 1997"
2:  "Copied from Generic Object (#12):property_conflicts by Slacker (#2) Aug 22 21:25:48 1997"
3:  "object:overb_conflicts(<newparent>)"
4:  "Looks for verbname conflicts that would keep chparent(object,newparent)"
5:  "  from working."
6:  "Returns a list of elements of the form {<verbname>, <object>}"
7:  "where <objectlist> is the object with the <verbname> -o."
8:  "If it returns {}, then no verb conflicts have been found."
9:  "Programmed by Picard (#7153) on Thursday August 6th, 1997."
10: {newparent} = args
11: if (!valid(newparent))
12:   return newparent == #-1 ? {} | raise(E_INVARG)
13: elseif (!$perm_utils:controls(caller_perms(), this) || !$perm_utils:perm_f(caller_perms(), newparent))
14:   "... if you couldn't chparent anyway, you don't need to know..."
15:   raise(E_PERM, "The prospective parent isn't yours, and it isn't fertile!")
16: endif
17: "... verbs existing on this"
18: "... cannot be -o on newparent, or it's ancestors."
19: verbs = verbs(this)
20: conflicts = {}
21: for o in ({newparent, @newparent:ancestors()})
22:   for p in (verbs(o))
23:     if (index(p, " "))
24:       "Okay, the verb has a space in it, showing it has more the one"
25:       "alias.  We'd better weed them all out to check."
26:       p = $su:words(p)
27:     else
28:       p = {p}
29:     endif
30:     for a in (p)
31:       "Okay, lets check for any asterix's (*) in the verb. If we"
32:       "don't find them, we'll screw up the verb_info() part. Also"
33:       "we want to get the verb from the start to the asterix, and"
34:       "the start to the end.  Watch out for multiple aliases too."
35:       p = $su:star_list(a)
36:       "We'll have to fix this later. :("
37:       for p in (p)
38:         if (p in verbs)
39:           i = verb_info(o, p)
40:           "Let's see if the verb is -o on the parent"
41:           if (!index(i[2], "o"))
42:             conflicts = {@conflicts, {p, o}}
43:             "Uh oh, the verb is -o. Tough luck."
44:           endif
45:         endif
46:       endfor
47:     endfor
48:     "I guess we need this in case the parent list gets too long <shrug>"
49:     $command_utils:suspend_if_needed()
50:   endfor
51: endfor
52: return conflicts
53: "Last modified by Slacker (#55) on Mon Jun 21 05:46:05 1999 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]