diff --git a/addons/common/functions/fnc_fixPosition.sqf b/addons/common/functions/fnc_fixPosition.sqf index a59c509a96..32cde87e52 100644 --- a/addons/common/functions/fnc_fixPosition.sqf +++ b/addons/common/functions/fnc_fixPosition.sqf @@ -18,8 +18,8 @@ private "_position"; _position = getPos _this; // don't place the object below the ground -if (_position select 2 < 0) then { - _position set [2, 0]; +if (_position select 2 < -0.1) then { + _position set [2, -0.1]; _this setPos _position; }; diff --git a/addons/dragging/CfgEventHandlers.hpp b/addons/dragging/CfgEventHandlers.hpp index 182f65f118..a74afd1df7 100644 --- a/addons/dragging/CfgEventHandlers.hpp +++ b/addons/dragging/CfgEventHandlers.hpp @@ -13,6 +13,16 @@ class Extended_PostInit_EventHandlers { }; class Extended_Init_EventHandlers { + class StaticWeapon { + class ADDON { + init = QUOTE(_this call DFUNC(initObject)); + }; + }; + class StaticMortar { + class ADDON { + init = QUOTE(_this call DFUNC(initObject)); + }; + }; class ReammoBox_F { class ADDON { init = QUOTE(_this call DFUNC(initObject)); diff --git a/addons/dragging/CfgVehicles.hpp b/addons/dragging/CfgVehicles.hpp index 37196b270f..5ac84b7038 100644 --- a/addons/dragging/CfgVehicles.hpp +++ b/addons/dragging/CfgVehicles.hpp @@ -1,5 +1,35 @@ class CfgVehicles { + // Static weapons + class LandVehicle; + class StaticWeapon: LandVehicle { + GVAR(canCarry) = 1; + GVAR(carryPosition[]) = {0,1.2,0}; + GVAR(carryDirection) = 0; + + GVAR(canDrag) = 1; + GVAR(dragPosition[]) = {0,1.2,0}; + GVAR(dragDirection) = 0; + }; + + //remove actions from Taru Pods + class Pod_Heli_Transport_04_base_F: StaticWeapon { + GVAR(canCarry) = 0; + GVAR(canDrag) = 0; + }; + + class StaticMortar; + class Mortar_01_base_F: StaticMortar { + GVAR(canCarry) = 1; + GVAR(carryPosition[]) = {0,1.2,0}; + GVAR(carryDirection) = 0; + + GVAR(canDrag) = 1; + GVAR(dragPosition[]) = {0,1.2,0}; + GVAR(dragDirection) = 0; + }; + + // ammo boxes class ThingX; class ReammoBox_F: ThingX { XEH_ENABLED; diff --git a/addons/dragging/functions/fnc_carryObject.sqf b/addons/dragging/functions/fnc_carryObject.sqf index 8ebf015800..1baa69b65d 100644 --- a/addons/dragging/functions/fnc_carryObject.sqf +++ b/addons/dragging/functions/fnc_carryObject.sqf @@ -31,6 +31,12 @@ private ["_position", "_direction"]; _position = _target getVariable [QGVAR(carryPosition), [0, 0, 0]]; _direction = _target getVariable [QGVAR(carryDirection), 0]; +// add height offset of model +private "_offset"; +_offset = (_target modelToWorld [0, 0, 0] select 2) - (_unit modelToWorld [0, 0, 0] select 2); + +_position = _position vectorAdd [0, 0, _offset]; + // attach object _target attachTo [_unit, _position]; _target setDir _direction; diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf index 1b86f24394..706c27ded9 100644 --- a/addons/dragging/functions/fnc_dropObject.sqf +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -27,6 +27,7 @@ _inBuilding = [_unit] call FUNC(isObjectOnObject); _unit playAction "released"; // prevent collision damage +["fixCollision", _unit, _unit] call EFUNC(common,targetEvent); ["fixCollision", _target, _target] call EFUNC(common,targetEvent); // release object diff --git a/addons/interact_menu/functions/fnc_compileMenu.sqf b/addons/interact_menu/functions/fnc_compileMenu.sqf index fe3da17917..e6a2744f03 100644 --- a/addons/interact_menu/functions/fnc_compileMenu.sqf +++ b/addons/interact_menu/functions/fnc_compileMenu.sqf @@ -18,7 +18,7 @@ private ["_objectType","_actionsVarName"]; _objectType = _target; if (typeName _target == "OBJECT") then { _objectType = typeOf _target; -};systemChat _objectType; +}; _actionsVarName = format [QGVAR(Act_%1), _objectType]; // Exit if the action menu is already compiled for this class diff --git a/addons/reload/functions/fnc_canCheckAmmo.sqf b/addons/reload/functions/fnc_canCheckAmmo.sqf index 3e83281b43..2cabe6edc2 100644 --- a/addons/reload/functions/fnc_canCheckAmmo.sqf +++ b/addons/reload/functions/fnc_canCheckAmmo.sqf @@ -13,7 +13,7 @@ EXPLODE_2_PVT(_this,_player,_target); -// Return true for static weapons if they have been fired once +// Return true for static weapons if they have been fired once, @todo 1.40 this work-around doesn't work anymore if (_target isKindOf "StaticWeapon") exitWith { (currentMagazine _target) != "" };