<commit_before>//	@file Version: 1.0
//	@file Name: detachTowedObject.sqf
//	@file Author: AgentRev
//	@file Created: 014/07/2013 14:54

private ["_object", "_tower", "_airdrop", "_pos", "_posZ", "_vel"];

if (typeName _this != "OBJECT") exitWith {};

_object = _this;

if (!isNull _object && {local _object}) then
{
	_tower = _object getVariable ["R3F_LOG_remorque", objNull];
	_airdrop = [_this, 1, false, [false]] call BIS_fnc_param;
	
	_object enableSimulation true; // FPS fix safeguard
	_tower enableSimulation true;
	
	if (_airdrop) then
	{
		_vel = velocity _object;
		detach _object;
		_object setVelocity _vel;
	}
	else
	{
		_pos = getPos _object;
		_posZ = (getPosATL _object) select 2;
		detach _object;
		_object setPosATL [_pos select 0, _pos select 1, (_posZ - (_pos select 2)) + 0.01];	
		_object setVelocity [0,0,0.01];
		_object lockDriver false;
		_objet enableCopilot true;
	};
};<commit_msg>Fixed issues with detachTowedObject (cherry picked from commit A3Wasteland/ArmA3_Wasteland.Altis@519fdd4411cfea30e0447147dc8fc58470fea377)<commit_after>//	@file Version: 1.0
//	@file Name: detachTowedObject.sqf
//	@file Author: AgentRev
//	@file Created: 014/07/2013 14:54

private ["_object", "_tower", "_airdrop", "_pos", "_altitude", "_vel"];

if (typeName _this != "OBJECT") exitWith {};

_object = _this;

if (!isNull _object && {local _object}) then
{
	_tower = attachedTo _object;
	_airdrop = [_this, 1, false, [false]] call BIS_fnc_param;
	
	_object enableSimulation true; // FPS fix safeguard
	_tower enableSimulation true;
	
	if (_airdrop) then
	{
		_vel = velocity _object;
		detach _object;
		_object setVelocity _vel;
	}
	else
	{
		_pos = getPos _object;
		_altitude = (getPosATL _object) select 2;
		detach _object;
		_object setVectorUp [0,0,1];
		_object setPosATL [_pos select 0, _pos select 1, (_altitude - (_pos select 2)) + 0.01];	
		_object setVelocity [0,0,0.01];
	};
	
	_object lockDriver false;
	_object enableCopilot true;
};
{'fraction_non_alphanumeric': 0.12793068297655455, 'fraction_numerical': 0.04434250764525994, 'mean_word_length': 4.392857142857143, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7472119', 'n_tokens_mistral': 836, 'n_tokens_neox': 743, 'n_words': 207}