<commit_before>// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
// ******************************************************************************************
//	@file Name: fn_restoreSavedVehicle.sqf
//	@file Author: AgentRev

#define STR_TO_SIDE(VAL) ([sideUnknown,BLUFOR,OPFOR,INDEPENDENT,CIVILIAN,sideLogic] select ((["WEST","EAST","GUER","CIV","LOGIC"] find toUpper (VAL)) + 1))

_pos = _pos apply { if (_x isEqualType "") then { parseNumber _x } else { _x } };

private _isUAV = (round getNumber (configFile >> "CfgVehicles" >> _class >> "isUav") > 0);

private ([["_flying"],[]] select isNil "_flying");
_flying = (!isNil "_flying" && {_flying > 0});

private _special = ["","FLY"] select (_isUAV && _flying);
private _tempPos = +_pos;

if (isNil "_safeDistance" && _special == "") then
{
	_tempPos set [2, 9000000 + random 999999];
};

_veh = createVehicle [_class, _tempPos, [], if (isNil "_safeDistance") then { 0 } else { _safeDistance }, _special];
_veh allowDamage false;
_veh hideObjectGlobal true;

//Make sure Blackwasp wings are folded
if (_veh iskindof "Plane_Fighter_01_Base_F") then 
{ 
	_veh animate ['wing_fold_l',1];	
	_veh animate ['wing_fold_r',1];	
	_veh animate ['wing_fold_cover_l',1];	
	_veh animate ['wing_fold_cover_r',1]; 
}; 
//Make sure Sentinal wings are folded
if (_veh iskindof "B_UAV_05_F") then
{
	_veh animate ["wing_fold_l_arm",1];
	_veh animate ["wing_fold_l",1];
	_veh animate ["wing_fold_cover_l_arm",1];
	_veh animate ["wing_fold_cover_l",1];
	_veh animate ["wing_fold_r_arm",1];
	_veh animate ["wing_fold_r",1];
	_veh animate ["wing_fold_cover_r_arm",1];
	_veh animate ["wing_fold_cover_r",1];
};

//Reload Service system
if ({_veh iskindof _x} count
	[
		"C_Offroad_01_repair_F",
		"C_Van_02_service_F",
		"C_Van_01_fuel_F",
		"B_G_Van_01_fuel_F",
		"B_Truck_01_fuel_F",
		"B_Truck_01_Repair_F",
		"B_Truck_01_ammo_F",
		"O_Truck_03_fuel_F",
		"O_Truck_03_repair_F",
		"O_Truck_03_ammo_F",
		"I_Truck_02_fuel_F",
		"I_Truck_02_ammo_F",
		"I_Truck_02_box_F",	
		"B_APC_Tracked_01_CRV_F",
		"O_Heli_Transport_04_ammo_F",
		"O_Heli_Transport_04_repair_F",
		"O_Heli_Transport_04_fuel_F"
	] >0)
then
{
	_vehicle spawn GOM_fnc_addAircraftLoadoutToObject;
};


private _velMag = vectorMagnitude velocity _veh;
<commit_msg>Fixed service vehicles not getting their option after restart<commit_after>// ******************************************************************************************
// * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 <EMAIL> *
// ******************************************************************************************
//	@file Name: fn_restoreSavedVehicle.sqf
//	@file Author: AgentRev

#define STR_TO_SIDE(VAL) ([sideUnknown,BLUFOR,OPFOR,INDEPENDENT,CIVILIAN,sideLogic] select ((["WEST","EAST","GUER","CIV","LOGIC"] find toUpper (VAL)) + 1))

_pos = _pos apply { if (_x isEqualType "") then { parseNumber _x } else { _x } };

private _isUAV = (round getNumber (configFile >> "CfgVehicles" >> _class >> "isUav") > 0);

private ([["_flying"],[]] select isNil "_flying");
_flying = (!isNil "_flying" && {_flying > 0});

private _special = ["","FLY"] select (_isUAV && _flying);
private _tempPos = +_pos;

if (isNil "_safeDistance" && _special == "") then
{
	_tempPos set [2, 9000000 + random 999999];
};

_veh = createVehicle [_class, _tempPos, [], if (isNil "_safeDistance") then { 0 } else { _safeDistance }, _special];
_veh allowDamage false;
_veh hideObjectGlobal true;

//Make sure Blackwasp wings are folded
if (_veh iskindof "Plane_Fighter_01_Base_F") then 
{ 
	_veh animate ['wing_fold_l',1];	
	_veh animate ['wing_fold_r',1];	
	_veh animate ['wing_fold_cover_l',1];	
	_veh animate ['wing_fold_cover_r',1]; 
}; 
//Make sure Sentinal wings are folded
if (_veh iskindof "B_UAV_05_F") then
{
	_veh animate ["wing_fold_l_arm",1];
	_veh animate ["wing_fold_l",1];
	_veh animate ["wing_fold_cover_l_arm",1];
	_veh animate ["wing_fold_cover_l",1];
	_veh animate ["wing_fold_r_arm",1];
	_veh animate ["wing_fold_r",1];
	_veh animate ["wing_fold_cover_r_arm",1];
	_veh animate ["wing_fold_cover_r",1];
};

//Reload Service system
if ({_veh iskindof _x} count
	[
		"C_Offroad_01_repair_F",
		"C_Van_02_service_F",
		"C_Van_01_fuel_F",
		"B_G_Van_01_fuel_F",
		"B_Truck_01_fuel_F",
		"B_Truck_01_Repair_F",
		"B_Truck_01_ammo_F",
		"O_Truck_03_fuel_F",
		"O_Truck_03_repair_F",
		"O_Truck_03_ammo_F",
		"I_Truck_02_fuel_F",
		"I_Truck_02_ammo_F",
		"I_Truck_02_box_F",	
		"B_APC_Tracked_01_CRV_F",
		"O_Heli_Transport_04_ammo_F",
		"O_Heli_Transport_04_repair_F",
		"O_Heli_Transport_04_fuel_F"
	] >0)
then
{
	_veh spawn GOM_fnc_addAircraftLoadoutToObject;
};


private _velMag = vectorMagnitude velocity _veh;

{'fraction_non_alphanumeric': 0.2077304671351798, 'fraction_numerical': 0.03079785035138487, 'mean_word_length': 6.287650602409639, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2654191', 'n_tokens_mistral': 2097, 'n_tokens_neox': 1897, 'n_words': 390}