@LabelIndex 421205
@StringIndex 0
class 1 Close_Door_maker : default_maker {
parameter:
	string	DoorName = "none";

handler:
	EventHandler ON_START() {
		myself.enabled = 0;
		myself::RegisterDoorEvent(DoorName,0);
	}

	EventHandler ON_DOOR_EVENT(enabled,i0,i1,def0) {
		if( enabled == 0 ) {
			if( myself.enabled ) {
				return;
			}
			myself.enabled = 1;
			for(i0 = 0; i0 < myself.def_count; i0++) {
				def0 = myself::GetSpawnDefine(i0);
				if( gg::IsNull(def0) == 0 ) {
					if( myself::AtomicIncreaseTotal(def0,def0.total,1) ) {
						def0::Spawn2(def0.total,0,0);
					}
				}
			}
		} else if( myself.enabled == 0 ) {
			return;
		}
		myself.enabled = 0;
		for(i1 = 0; i1 < myself.def_count; i1++) {
			def0 = myself::GetSpawnDefine(i1);
			if( gg::IsNull(def0) == 0 ) {
				def0::Despawn();
			}
		}
	}

	EventHandler ON_NPC_CREATED(created_npc) {
		if( myself.enabled == 0 ) {
			created_npc::Despawn();
		}
	}

	EventHandler ON_NPC_DELETED(deleted_def,i0,i1,maker0) {
	}

}
