ldmud-3.4.1/doc/
ldmud-3.4.1/doc/efun.de/
ldmud-3.4.1/doc/efun/
ldmud-3.4.1/doc/man/
ldmud-3.4.1/doc/other/
ldmud-3.4.1/mud/
ldmud-3.4.1/mud/heaven7/
ldmud-3.4.1/mud/lp-245/
ldmud-3.4.1/mud/lp-245/banish/
ldmud-3.4.1/mud/lp-245/doc/
ldmud-3.4.1/mud/lp-245/doc/examples/
ldmud-3.4.1/mud/lp-245/doc/sefun/
ldmud-3.4.1/mud/lp-245/log/
ldmud-3.4.1/mud/lp-245/obj/Go/
ldmud-3.4.1/mud/lp-245/players/lars/
ldmud-3.4.1/mud/lp-245/room/death/
ldmud-3.4.1/mud/lp-245/room/maze1/
ldmud-3.4.1/mud/lp-245/room/sub/
ldmud-3.4.1/mud/lp-245/secure/
ldmud-3.4.1/mud/morgengrauen/
ldmud-3.4.1/mud/morgengrauen/lib/
ldmud-3.4.1/mud/sticklib/
ldmud-3.4.1/mud/sticklib/src/
ldmud-3.4.1/mudlib/uni-crasher/
ldmud-3.4.1/pkg/
ldmud-3.4.1/pkg/debugger/
ldmud-3.4.1/pkg/diff/
ldmud-3.4.1/pkg/misc/
ldmud-3.4.1/src/autoconf/
ldmud-3.4.1/src/hosts/
ldmud-3.4.1/src/hosts/GnuWin32/
ldmud-3.4.1/src/hosts/amiga/
ldmud-3.4.1/src/hosts/win32/
ldmud-3.4.1/src/ptmalloc/
ldmud-3.4.1/src/util/
ldmud-3.4.1/src/util/erq/
ldmud-3.4.1/src/util/indent/hosts/next/
ldmud-3.4.1/src/util/xerq/
ldmud-3.4.1/src/util/xerq/lpc/
ldmud-3.4.1/src/util/xerq/lpc/www/
ldmud-3.4.1/test/t-030925/
ldmud-3.4.1/test/t-040413/
ldmud-3.4.1/test/t-041124/
SYNOPSIS
        void set_this_object(object object_to_pretend_to_be);

DESCRIPTION
        This is a privileged function, only to be used in the master
        object or in the simul_efun object.

        It changes the result of this_object() in the using function,
        and the result of previous_object() in functions called in
        other objects by call_other()/apply()/funcall(). Its effect will
        remain till there is a return of an external function call, or
        another call of set_this_object(). While executing code in the
        master object's program or the primary simul_efun object's
        program, set_this_object() is granted even if this_object() is
        altered by set_this_object(). This does not apply to functions
        inherited from other programs.

        Use it with extreme care to avoid inconsistencies.  After a
        call of set_this_object(), some LPC-constructs might behave in
        an odd manner, or even crash the system. In particular, using
        global variables or calling local functions (except by
        call_other) is illegal and actively prevented.

        Allowed are call_other(), map functions, access of local variables
        (which might hold array pointers to a global array), simple arithmetic
        and the assignment operators.

BUGS
        It is currently not possible to directly restore the original
        current object. So instead of writing

          object me = this_object();
          set_this_object(that);
          <some code>
          set_this_object(me);
          <more code>

        one has to use a workaround:

          private void doit (object that) {
            set_this_object(that);
            <some code>
          }

          funcall(#'doit, that);
          <more code>

        Some people would consider this a feature.


HISTORY
        LDMud 3.2.10 actively prevents references to global variables
        and function calls by address while set_this_object() is in
        effect.

SEE ALSO
        this_object(E), set_this_player(E)