Update doc/efun/ aus Driversourcen.
Manpages der efuns aktualisiert, neue Manpages hinzugefuegt.
Change-Id: I7cc91684269ff56d1aef47d5c5e7c87f7fd531dc
diff --git a/doc/efun/set_this_object b/doc/efun/set_this_object
index 1aa0c6a..2af7e1d 100644
--- a/doc/efun/set_this_object
+++ b/doc/efun/set_this_object
@@ -1,60 +1,56 @@
-GESCHUETZT
SYNOPSIS
- void set_this_object(object|lwobject objekt-an-stelle-von-originalobjekt)
+ void set_this_object(object|lwobject object_to_pretend_to_be)
-BESCHREIBUNG
- Dies ist eine geschuetzte Funktion, die nur vom Master-Objekt und im
- Simul-Efun-Objekt genutzt werden darf. Bei sonstiger Benutzung
- erzeugt diese Funktion einen Fehler.
+DESCRIPTION
+ This is a privileged function, only to be used in the master
+ object or in the simul_efun object.
- Die Funktion aendert das Resultat von this_object() in der laufenden
- Funktion, ebenso das Resultat von previous_object() in Funktionen in
- anderen Objekten, die einen call_other() Aufruf machen.
+ 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.
- Der Effekt von set_this_object() bleibt bestehen, bis ein externer
- Funktionsaufruf abgeschlossen ist oder bis zu einem erneuten Aufruf
- von set_this_object(). Waehrend der Ausfuehrung von Code im
- Master-Objekt oder im Simul-Efun-Objekt ist set_this_object()
- garantiert, auch wenn this_object() durch set_this_object()
- veraendert wird. Die gilt nicht fuer Funktionen, die aus anderen
- Programmen geerbt werden.
+ 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.
- Diese Funktion darf nur mit hoechster Sorgfalt verwendet werden, um
- Inkonsistenzen zu vermeiden. Nach einem Aufruf von set_this_object()
- koennen sich gewisse LPC-Konstrukte merkwuerdig verhalten oder gar
- das System zum Absturz bringen. Insbesondere die Verwendung von
- globalen Variablen oder der Aufruf von lokalen Funktionen (ausser
- durch call_other()) ist unzulaessig und wird aktiv verhindert.
+ 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.
- Erlaubt sind call_other(), map(), der Zugriff auf lokale Variablen
- (die auch Pointers auf globale Arrays enthalten duerfen), einfache
- Arithmetik und der Zuweisungs-Operator.
+BUGS
+ It is currently not possible to directly restore the original
+ current object. So instead of writing
-FEHLER
- Es ist momentan nicht moeglich, das originale gueltige Objekt wieder
- herzustellen. Anstelle von:
+ object me = this_object();
+ set_this_object(that);
+ <some code>
+ set_this_object(me);
+ <more code>
- object ich = this_object();
- set_this_object(dings);
- <irgendwelcher Code>
- set_this_object(ich);
- <mehr Code>
+ one has to use a workaround:
- muss das ueber einen Umweg geloest werden:
+ private void doit (object that) {
+ set_this_object(that);
+ <some code>
+ }
- private void tuwas(object dings) {
- set_this_object(dings);
- <irgendwelcher code>
- }
+ funcall(#'doit, that);
+ <more code>
- funcall(#'tuwas, dings);
- <mehr Code>
+ Some people would consider this a feature.
- Manche Leute bezeichnen das als Feature.
+HISTORY
+ LDMud 3.2.10 actively prevents references to global variables
+ and function calls by address while set_this_object() is in
+ effect.
-GESCHICHTE
- LDMud 3.2.10 verhindert aktiv die Referenz auf globale Variablen und
- Funktionsaufrufe nach Adresse, waehrend set_this_object() gilt.
-
-SIEHE AUCH
+SEE ALSO
this_object(E), set_this_player(E)