mirror of
https://github.com/ldmud/ldmud
synced 2026-08-12 14:26:05 -04:00
Driver hooks that accepted lfun closures before can now handle any type of closure. Also the H_CREATE_* hooks can now handle any type of closure.
37 lines
1.4 KiB
Text
37 lines
1.4 KiB
Text
SYNOPSIS
|
|
#include <sys/driver_hooks.h>
|
|
|
|
set_driver_hook(H_CREATE_OB, value)
|
|
|
|
<value> being:
|
|
|
|
void <name> ( void )
|
|
int <closure> ( void )
|
|
int <closure> (object obj_to_init)
|
|
|
|
DESCRIPTION
|
|
Optional hooks to initialize an explicitly loaded object/blueprint
|
|
after creation. Hook setting can be any closure, or the name of
|
|
the function (static or public) to call in the object.
|
|
|
|
If the hook is an unbound lambda closure expecting an argument,
|
|
it is bound to the current object and called with the created
|
|
object as argument. If the hook is an unbound lambda closure
|
|
without arguments, it is bound to the object to be initalized
|
|
and called. If the hook is any other type of closure, it is called
|
|
with the created object as argument.
|
|
|
|
If the result of the closure call is a non-zero number, it is used
|
|
as the interval to wait before the first reset(), else the default
|
|
interval computed from TIME_TO_RESET is used.
|
|
|
|
If the hook is defined as the name of an lfun in the object,
|
|
it is called in the object with no argument and any result
|
|
is ignored.
|
|
|
|
HISTORY
|
|
LDMud 3.2.10 allowed static functions to be given by name.
|
|
LDMud 3.6.5 removed the argument given for the lfun call.
|
|
|
|
SEE ALSO
|
|
hooks(C), create_super(H), create_clone(H), create_lwobject(H)
|