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.
This commit is contained in:
PabstMirror 2016-04-12 12:12:49 -05:00
parent fa2b6dac2d
commit 5d70db3d9b
3 changed files with 12 additions and 22 deletions

View File

@ -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", {

View File

@ -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

View File

@ -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";