bits_controller.c
final_realms_fluffos_v1/lib/obj/handlers/bits_controller.c · 556 B
From the archive final_realms_fluffos_v1.zip
Download the archive « Back to the archive contents
/* the bits controller.... Doesn't do overly much... */
object *bits;
#define TIME_OUT 60
void create() {
bits = ({ });
}
void add_bit(object ob) {
bits += ({ ob });
call_out("do_update", TIME_OUT);
}
void remove_bit(object ob) {
int i;
if ((i = member_array(ob, bits)) == -1)
return ;
bits = delete(bits, i, 1);
}
void do_update() {
mixed *neww;
int i;
neww = unique_array(bits, "do_decay");
if ((i = member_array(1, neww)) == -1) {
bits = ({ });
return ;
}
bits = neww[i+1];
call_out("do_update", TIME_OUT);
}