Merge pull request #3688 from acemod/fixLoadingIntoFries

LoadPerson - Only try vehicles that have room
This commit is contained in:
Glowbal 2016-04-14 08:25:03 +02:00
commit 5165db73e8
4 changed files with 18 additions and 23 deletions

View File

@ -133,6 +133,7 @@ if (isServer) then {
["fixFloating", FUNC(fixFloating)] call FUNC(addEventhandler); ["fixFloating", FUNC(fixFloating)] call FUNC(addEventhandler);
["fixPosition", FUNC(fixPosition)] call FUNC(addEventhandler); ["fixPosition", FUNC(fixPosition)] call FUNC(addEventhandler);
["loadPersonEvent", FUNC(loadPersonLocal)] call FUNC(addEventhandler);
["unloadPersonEvent", FUNC(unloadPersonLocal)] call FUNC(addEventhandler); ["unloadPersonEvent", FUNC(unloadPersonLocal)] call FUNC(addEventhandler);
["lockVehicle", { ["lockVehicle", {

View File

@ -21,33 +21,18 @@ private _vehicle = objNull;
if (!([_caller, _unit, ["isNotDragging", "isNotCarrying"]] call FUNC(canInteractWith)) || {_caller == _unit}) exitWith {_vehicle}; 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; TRACE_1("",_x);
} else { if ((_x emptyPositions "cargo" > 0) || {_x emptyPositions "gunner" > 0}) exitWith {
private _loadair = nearestObject [_unit, "Air"]; _vehicle = _x;
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;
};
};
}; };
}; } forEach _nearVehicles;
if (!isNull _vehicle) then { if (!isNull _vehicle) then {
[_unit, true, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide); [_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 _vehicle

View File

@ -73,6 +73,10 @@ class CfgVehicles {
class ACE_friesBase: Helicopter_Base_F { class ACE_friesBase: Helicopter_Base_F {
destrType = ""; destrType = "";
class Turrets {}; class Turrets {};
class ACE_Actions {};
class ACE_SelfActions {};
EGVAR(cargo,hasCargo) = 0;
EGVAR(cargo,space) = 0;
}; };
class ACE_friesAnchorBar: ACE_friesBase { class ACE_friesAnchorBar: ACE_friesBase {
author = "jokoho48"; author = "jokoho48";
@ -205,7 +209,7 @@ class CfgVehicles {
GVAR(enabled) = 2; GVAR(enabled) = 2;
GVAR(ropeOrigins)[] = {"ropeOriginRight", "ropeOriginLeft"}; GVAR(ropeOrigins)[] = {"ropeOriginRight", "ropeOriginLeft"};
GVAR(friesType) = "ACE_friesGantryReverse"; GVAR(friesType) = "ACE_friesGantryReverse";
GVAR(friesAttachmentPoint)[] = {1.04, 2.5, -0.34}; GVAR(friesAttachmentPoint)[] = {-1.04, 2.5, -0.34};
EQUIP_FRIES_ATTRIBUTE; EQUIP_FRIES_ATTRIBUTE;
}; };
class Heli_light_03_unarmed_base_F: Heli_light_03_base_F { class Heli_light_03_unarmed_base_F: Heli_light_03_base_F {

View File

@ -1,6 +1,11 @@
#define COMPONENT fastroping #define COMPONENT fastroping
#include "\z\ace\addons\main\script_mod.hpp" #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 #ifdef DEBUG_ENABLED_FASTROPING
#define DEBUG_MODE_FULL #define DEBUG_MODE_FULL
#endif #endif