SYNOPSIS

mixed prepare_destruct( object obj)

DESCRIPTION

Prepare the destruction of the object obj. Return 0 if the object is ready for destruction; any other value will abort the attempt. If a string is returned, an error with the string as message will be issued.

The interpreter calls this function whenever an object shall be destructed. It expects that this function cleans the inventory of the object, or the destruct will fail. It is also recommended to clean up all shadows on obj at this point.

Furthermore, the function could notify the former inventory objects that their holder is under destruction (useful to move users out of rooms which are updated); and it could announce systemwide the destruction (quitting) of users.

Another use for this apply is to take care of any other ‘cleanup’ work needed to be done, like adjusting weights, light levels, and such. Alternatively and traditionally this is done by calling an lfun remove(A) in the object, which then calls destruct(E) after performing all the adjustments.

Strange things will happen if the master object does not provide this function.