From 5d70db3d9b12ef5131f1aae87cc0b43fb805f592 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 12 Apr 2016 12:12:49 -0500 Subject: [PATCH 1/2] LoadPerson - Only try vehicles that have room Fix #2965 The FRIES is a "Helicopter" so we were trying to load into it, because it was closest. Also disable Cargo system on it so we don't load other things into it And remove all interactions on it as well. --- addons/common/XEH_postInit.sqf | 1 + addons/common/functions/fnc_loadPerson.sqf | 29 ++++++---------------- addons/fastroping/CfgVehicles.hpp | 4 +++ 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index ae1014ddc8..4c05b1cf7a 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -133,6 +133,7 @@ if (isServer) then { ["fixFloating", FUNC(fixFloating)] call FUNC(addEventhandler); ["fixPosition", FUNC(fixPosition)] call FUNC(addEventhandler); +["loadPersonEvent", FUNC(loadPersonLocal)] call FUNC(addEventhandler); ["unloadPersonEvent", FUNC(unloadPersonLocal)] call FUNC(addEventhandler); ["lockVehicle", { diff --git a/addons/common/functions/fnc_loadPerson.sqf b/addons/common/functions/fnc_loadPerson.sqf index 3071ffbd47..6c728134d1 100644 --- a/addons/common/functions/fnc_loadPerson.sqf +++ b/addons/common/functions/fnc_loadPerson.sqf @@ -21,33 +21,18 @@ private _vehicle = objNull; if (!([_caller, _unit, ["isNotDragging", "isNotCarrying"]] call FUNC(canInteractWith)) || {_caller == _unit}) exitWith {_vehicle}; -private _loadcar = nearestObject [_unit, "Car"]; +private _nearVehicles = nearestObjects [_unit, ["Car", "Air", "Tank", "Ship_F"], 10]; -if (_unit distance _loadcar <= 10) then { - _vehicle = _loadcar; -} else { - private _loadair = nearestObject [_unit, "Air"]; - - if (_unit distance _loadair <= 10) then { - _vehicle = _loadair; - } else { - private _loadtank = nearestObject [_unit, "Tank"]; - - if (_unit distance _loadtank <= 10) then { - _vehicle = _loadtank; - } else { - private _loadboat = nearestObject [_unit, "Ship_F"]; - - if (_unit distance _loadboat <= 10) then { - _vehicle = _loadboat; - }; - }; +{ + TRACE_1("",_x); + if ((_x emptyPositions "cargo" > 0) || {_x emptyPositions "gunner" > 0}) exitWith { + _vehicle = _x; }; -}; +} forEach _nearVehicles; if (!isNull _vehicle) then { [_unit, true, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide); - [[_unit, _vehicle, _caller], QFUNC(loadPersonLocal), _unit, false] call FUNC(execRemoteFnc); + ["loadPersonEvent", _unit, [_unit, _vehicle, _caller]] call FUNC(objectEvent); }; _vehicle diff --git a/addons/fastroping/CfgVehicles.hpp b/addons/fastroping/CfgVehicles.hpp index a9f5ebfbad..dcd399508b 100644 --- a/addons/fastroping/CfgVehicles.hpp +++ b/addons/fastroping/CfgVehicles.hpp @@ -73,6 +73,10 @@ class CfgVehicles { class ACE_friesBase: Helicopter_Base_F { destrType = ""; class Turrets {}; + class ACE_Actions {}; + class ACE_SelfActions {}; + EGVAR(cargo,hasCargo) = 0; + EGVAR(cargo,space) = 0; }; class ACE_friesAnchorBar: ACE_friesBase { author = "jokoho48"; From d7b0bde1ca3e6c455d63538f773733a615bc9b0b Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 12 Apr 2016 12:28:48 -0500 Subject: [PATCH 2/2] Fix Wildcat attach point --- addons/fastroping/CfgVehicles.hpp | 2 +- addons/fastroping/script_component.hpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/fastroping/CfgVehicles.hpp b/addons/fastroping/CfgVehicles.hpp index dcd399508b..609e386e68 100644 --- a/addons/fastroping/CfgVehicles.hpp +++ b/addons/fastroping/CfgVehicles.hpp @@ -209,7 +209,7 @@ class CfgVehicles { GVAR(enabled) = 2; GVAR(ropeOrigins)[] = {"ropeOriginRight", "ropeOriginLeft"}; GVAR(friesType) = "ACE_friesGantryReverse"; - GVAR(friesAttachmentPoint)[] = {1.04, 2.5, -0.34}; + GVAR(friesAttachmentPoint)[] = {-1.04, 2.5, -0.34}; EQUIP_FRIES_ATTRIBUTE; }; class Heli_light_03_unarmed_base_F: Heli_light_03_base_F { diff --git a/addons/fastroping/script_component.hpp b/addons/fastroping/script_component.hpp index ccfa2c3e56..3770bfe0d4 100644 --- a/addons/fastroping/script_component.hpp +++ b/addons/fastroping/script_component.hpp @@ -1,6 +1,11 @@ #define COMPONENT fastroping #include "\z\ace\addons\main\script_mod.hpp" +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE +// #define CBA_DEBUG_SYNCHRONOUS +// #define ENABLE_PERFORMANCE_COUNTERS + #ifdef DEBUG_ENABLED_FASTROPING #define DEBUG_MODE_FULL #endif