View/Edit #8259:_move_obj _move!_obj

Switch to edit mode.

Name(s): _move_obj _move!_obj
1:  "Copied from Generic Player (#12):_move_obj by Slacker (#55)Sep 20 11:47:36 2001"
2:  "Move an object.  Called by @move & @join."
3:  if (this != caller)
4:    raise(E_PERM)
5:  endif
6:  set_task_perms(this)
7:  {dobj, moveto} = args
8:  nice = !index(verb, "!")
9:  if (typeof(moveto) == $OBJ)
10:   iobjstr = tostr(iobj = moveto)
11: else
12:   iobj = this:my_match_object(iobjstr = moveto)
13: endif
14: if (iobj != $nothing && $command_utils:object_match_failed(iobj, iobjstr))
15:   return
16: endif
17: old_loc = dobj.location
18: if (old_loc == iobj)
19:   $msg:mtell("already_there", dobj, iobj)
20:   return
21: endif
22: try
23:   r = this:_move(dobj, iobj, !nice)
24:   if (dobj.location != old_loc)
25:     "Note that the move is now done *before* notifiers are printed."
26:     "This avoids 'traps' when someone accidentally (deliberately?) breaks a notify verb or whatnot."
27:     "Write all the funky notifiers."
28:     valid(old_loc) && $msg:lmtell({dobj}, {dobj.location}, {old_loc, ""}, "msg_odepart")
29:     if (dobj.location == iobj)
30:       valid(dobj.location) && $msg:lmtell({dobj}, {old_loc}, {dobj, "msg_arrive"}, "msg_oarrive")
31:       $msg:mtell("moved", old_loc)
32:     else
33:       "Quack?"
34:       valid(dobj.location) && $msg:lmtell({dobj}, {old_loc}, {dobj, "msg_arrive_quack"}, "msg_oarrive_quack")
35:       $msg:mtell("deflected", old_loc)
36:     endif
37:   endif
38:   "Move failed; try tells us the explanation."
39: except (E_NACC)
40:   $msg:mtell("bounced", old_loc)
41: except (E_RANGE)
42:   $msg:mtell("move2far", old_loc)
43: except (E_RECMOVE)
44:   $msg:mtell("topology", dobj, iobj)
45: except error (ANY)
46:   $msg:mtell("stubborn", old_loc, error[2])
47: endtry
48: "Last modified by Dax (#789) on Tue May  3 13:47:11 2005 MDT."

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

You are not logged in.

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