VERALTET
SYNOPSIS
int transfer(object item, object dest)
BESCHREIBUNG
Diese Funktion existiert lediglich aus Kompatibilitaetsgrunden, und
dann auch nur, wennn der Driver mit USE_DEPRECATED kompiliert wird.
Das Object <item> wird in Objekt <dest> bewegt. Verschiedene Tests
werden durchgefuehrt, und das Resultat beschreibt den (Miss)Erfolg:
0: Erfolg.
1: Zu schwer fuer <dest>
2: Kann nicht fallen gelassen werden.
3: Kann nicht aus seinem Behaelter genommen werden.
4: <item> kann in keinen Behaelter gesteckt werden.
5: <dest> akzeptiert <item> nicht.
6: <item> kann nicht aufgenommen werden.
Die Funktion ruft die lfuns add_weight(), drop(), get(),
prevent_insert(), add_weight(), und can_put_and_get() nach Bedarf..
REPLACEMENT
Diese Funktion kann einfach mit einer simul-efun simuliert werden:
/*--------------------------------------------------------*/
int transfer(object item, object dest)
{
int weight;
object from;
efun::set_this_object(previous_object());
weight = item->query_weight();
if (!item)
return 3;
from = environment(item);
if (from)
{
/*
* If the original place of the object is a living object,
* then we must call drop() to check that the object can be
* dropped.
*/
if (living(from))
{
if (item->drop() || !item)
return 2;
}
/*
* If 'from' is not a room and not a player, check that we may
* remove things out of it.
*/
else if (environment(from))
{
if (!from->can_put_and_get() || !from)
return 3;
}
}
/*
* If the destination is not a room, and not a player,
* Then we must test 'prevent_insert', and 'can_put_and_get'.
*/
if (environment(dest) && !living(dest))
{
if (item->prevent_insert())
return 4;
if (!dest->can_put_and_get() || !dest)
return 5;
}
if (living(dest))
{
if (!item->get() || !item)
return 6;
}
/*
* If it is not a room, correct the total weight in the
* destination.
*/
if (environment(dest) && weight)
{
if (!dest->add_weight(weight) || !dest)
return 1;
}
/*
* If it is not a room, correct the weight in the 'from' object.
*/
if (from && environment(from) && weight)
{
from->add_weight(-weight);
}
move_object(item, dest);
return 0;
}
/*--------------------------------------------------------*/
SIEHE AUCH
move_object(E), drop(A), get(A), prevent_insert(A),
can_put_and_get(A), add_weight(A)