MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 1 | SYNOPSIS |
Zesstra | 7ea4a03 | 2019-11-26 20:11:40 +0100 | [diff] [blame] | 2 | mixed prepare_destruct(object obj) |
MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 3 | |
| 4 | DESCRIPTION |
Zesstra | 7ea4a03 | 2019-11-26 20:11:40 +0100 | [diff] [blame] | 5 | 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 User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 9 | |
Zesstra | 7ea4a03 | 2019-11-26 20:11:40 +0100 | [diff] [blame] | 10 | 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 User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 14 | |
Zesstra | 7ea4a03 | 2019-11-26 20:11:40 +0100 | [diff] [blame] | 15 | 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 User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame] | 29 | |
| 30 | SEE ALSO |
Zesstra | 7ea4a03 | 2019-11-26 20:11:40 +0100 | [diff] [blame] | 31 | remove_player(M), destruct(E) |