blob: f24391f819ad9ea5c3737759ced1d1006c7921b5 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
Zesstra7ea4a032019-11-26 20:11:40 +01002 mixed prepare_destruct(object obj)
MG Mud User88f12472016-06-24 23:31:02 +02003
4DESCRIPTION
Zesstra7ea4a032019-11-26 20:11:40 +01005 Prepare the destruction of the object obj. Return 0 if the
6 object is ready for destruction; any other value will abort
7 the attempt. If a string is returned, an error with the string
8 as message will be issued.
MG Mud User88f12472016-06-24 23:31:02 +02009
Zesstra7ea4a032019-11-26 20:11:40 +010010 The interpreter calls this function whenever an object shall
11 be destructed. It expects that this function cleans the
12 inventory of the object, or the destruct will fail. It is also
13 recommended to clean up all shadows on obj at this point.
MG Mud User88f12472016-06-24 23:31:02 +020014
Zesstra7ea4a032019-11-26 20:11:40 +010015 Furthermore, the function could notify the former inventory
16 objects that their holder is under destruction (useful to move
17 users out of rooms which are updated); and it could announce
18 systemwide the destruction(quitting) of users.
19
20 Another use for this apply is to take care of any other
21 'cleanup' work needed to be done, like adjusting weights,
22 light levels, and such. Alternatively and traditionally this
23 is done by calling an lfun 'remove()' in the object, which
24 then calls the efun destruct() after performing all the
25 adjustments.
26
27 Strange things will happen if the master object does not
28 provide this function.
MG Mud User88f12472016-06-24 23:31:02 +020029
30SEE ALSO
Zesstra7ea4a032019-11-26 20:11:40 +010031 remove_player(M), destruct(E)