Skip to main content

setup_eat

Discworld food help

setup_eat

Name

setup_eat - Sets up the eat object and function.

Syntax

int setup_eat(object ob, string func);

Description

Sets the eat object and function of the food. This is used when the food is eaten, the eat function on the eat object is called when the food is eaten. The eat message is displayed at this point.

The function will be called with two parameters, the first being the object being eaten and the second being the person eating the object.

Example

void create_food() {
object food;

food = clone_object("/obj/food/apple.food");
food->setup_eat(this_object(), "eat_rabbit");
} /* create_food() */

void eat_rabbit(object food, object eater) {
/* Do something wonderful! */
} /* eat_rabbit() */

See also

set_eat_func, query_eat_object, set_eat_message, query_eat_func, query_eat_mess, set_eat_object