freezer.c

foundationI_fluffos_v1/lib/domains/Standard/xtra/freezer.c · 955 B

From the archive foundation1_fluffos_v1.zip

Download the archive   « Back to the archive contents

#include <std.h>
#include <config.h>
#include <rooms.h>

inherit ROOM;

static private object *old;

void create() {
    ::create();
    set_property("no teleport", 1);
    set_short( "The freezer");
    set_long( "The local freezer.");
    set_exits( 
	      (["square" : "/domains/standard/square"]) );
    set_no_clean(1);
    call_out("clean_room", MAX_NET_DEAD_TIME);
}

static void clean_room() {
    object *in_here, *to_clean;
    int i;

    if(!sizeof(in_here = filter_array(all_inventory(this_object()), 
      (: living :)))) {
        old = in_here;
        call_out("clean_room", MAX_NET_DEAD_TIME);
        return;
    }
    i = sizeof(to_clean = (object *)(in_here & (object *)(pointerp(old) ? old : ({}))));
    old = in_here - to_clean;
    while(i--) to_clean[i]->clean_net_dead();
    i = sizeof(to_clean = all_inventory(this_object()) - in_here);
    while(i--) to_clean[i]->remove();
    call_out("clean_room", MAX_NET_DEAD_TIME);
}

Site Stats

Snippets: 1791
Codebases: 571