setup.connectedLocationAdd = function(label:string,destination:LocationIdentifier,duration:number,image:string,content:string,flags:ConnectedLocationFlags){
    let _connectedLocationData:ConnectedLocation = {
			forPassage : passage(),
			destination: destination,
			label: label,
			image: image,
			duration: duration,
			class: 'connectedLocation',
			priority: 0,
			content: content,
			hotkeys: [],
			indecencyBlocked:false,
			capturedVars: {},
			tags:[]
		};

        flags ??= {};

		if(flags.class){
			_connectedLocationData.class += " " + flags.class;
		}
		if(flags.priority){
			_connectedLocationData.priority = flags.priority;
		}
		if(flags.hotkeys){
			_connectedLocationData.hotkeys = flags.hotkeys;
		}
		if(flags.tags){
			_connectedLocationData.tags = flags.tags;
		}
		_connectedLocationData.indecencyBlocked = flags.indecencyBlocked ? true : false;

		let _allowedVehicles = flags.allowedVehicles;
		if(_allowedVehicles){
			if(!_allowedVehicles.includes(State.variables.pc.vehicleType)){
				return;
			}
		}
		let _capture = flags.capture ?? [];

		for(const _key of _capture){
			_connectedLocationData.capturedVars[_key] = clone(State.getVar(_key));
		}


		switch(State.variables.pc.vehicleType){
			case 'car':
				_connectedLocationData.duration = Math.ceil(_connectedLocationData.duration / State.variables.pc.vehicleSpeed);
		}


		State.variables.connectedLocations ??= [];
		State.variables.connectedLocations.push(_connectedLocationData);

}