diff --git a/addons/common/functions/fnc_deserializeObjects.sqf b/addons/common/functions/fnc_deserializeObjects.sqf index a4944f60e..5882c2125 100644 --- a/addons/common/functions/fnc_deserializeObjects.sqf +++ b/addons/common/functions/fnc_deserializeObjects.sqf @@ -135,7 +135,11 @@ private _fnc_deserializeVehicle = { private _placement = ["CAN_COLLIDE", "FLY"] select (_type isKindOf "Air" && {_position select 2 > 5}); private _vehicle = createVehicle [_type, _position, [], 0, _placement]; - _vehicle setDir _direction; + if (_direction isEqualType 0) then { + _vehicle setDir _direction; + } else { + _vehicle setVectorDirAndUp _direction; + }; // FLY placement always places aircraft at the same height relative to the ground if (_placement == "FLY") then { @@ -223,7 +227,11 @@ private _fnc_deserializeStatic = { private _object = createVehicle [_type, [0, 0, 0], [], 0, "CAN_COLLIDE"]; _object setPos _position; - _object setDir _direction; + if (_direction isEqualType 0) then { + _object setDir _direction; + } else { + _object setVectorDirAndUp _direction; + }; // Composition placement aligns objects to the surface normal if they are close to the ground // This also helps in preventing objects from being destroyed by cliping into the ground diff --git a/addons/common/functions/fnc_serializeObjects.sqf b/addons/common/functions/fnc_serializeObjects.sqf index ba8c38c48..221cbed3f 100644 --- a/addons/common/functions/fnc_serializeObjects.sqf +++ b/addons/common/functions/fnc_serializeObjects.sqf @@ -114,7 +114,7 @@ private _fnc_serializeVehicle = { private _type = typeOf _vehicle; private _position = ASLtoAGL getPosASL _vehicle vectorDiff _centerPos; - private _direction = getDir _vehicle; + private _direction = [vectorDir _vehicle, vectorUp _vehicle]; private _fuel = fuel _vehicle; private _inventory = _vehicle call FUNC(serializeInventory); @@ -177,7 +177,7 @@ private _fnc_serializeStatic = { private _type = typeOf _object; private _position = ASLtoAGL getPosASL _object vectorDiff _centerPos; - private _direction = getDir _object; + private _direction = [vectorDir _object, vectorUp _object]; private _simulationEnabled = simulationEnabled _object; private _inventory = _object call FUNC(serializeInventory);