mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #3688 from acemod/fixLoadingIntoFries
LoadPerson - Only try vehicles that have room
This commit is contained in:
commit
5165db73e8
@ -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", {
|
||||
|
@ -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
|
||||
|
@ -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";
|
||||
@ -205,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 {
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user