View/Edit #13:_rename_prop

Switch to edit mode.

Name(s): _rename_prop
1:  "Rename a property.  Called by @rename."
2:  set_task_perms(caller_perms())
3:  {object, pname, iobjstr} = args
4:  info = `property_info(object, pname) ! ANY'
5:  if (info == E_PROPNF)
6:    $msg:mtell("noprop", object, pname)
7:  elseif (typeof(info) == $ERR)
8:    player:tell(info)
9:  else
10:   if (iobjstr[1] == ".")
11:     iobjstr = iobjstr[2..$]
12:   elseif (to = $code_utils:parse_propref(iobjstr))
13:     if (object == player:my_match_object(to[1]))
14:       "The specified target object was the source."
15:       iobjstr = to[2]
16:     else
17:       "This is really a @move, not a @rename"
18:       return this:_move_prop(@args)
19:     endif
20:   endif
21:   e = `set_property_info(object, pname, {@info, iobjstr}) ! ANY'
22:   if (typeof(e) == $ERR)
23:     player:tell("Renaming ", object, ".", pname, " --> ", e)
24:   else
25:     player:tell(object, ".", pname, " renamed to .", iobjstr)
26:   endif
27: endif
28: "Last modified by Dax (#789) on Tue May  3 13:45:55 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]