Skip to content

Commit

Permalink
Merge pull request #3688 from acemod/fixLoadingIntoFries
Browse files Browse the repository at this point in the history
LoadPerson - Only try vehicles that have room
  • Loading branch information
thojkooi committed Apr 14, 2016
2 parents fa2b6da + d7b0bde commit 5165db7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 24 deletions.
1 change: 1 addition & 0 deletions addons/common/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand Down
31 changes: 8 additions & 23 deletions addons/common/functions/fnc_loadPerson.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,18 @@ private _vehicle = objNull;

if (!([_caller, _unit, ["isNotDragging", "isNotCarrying"]] call FUNC(canInteractWith)) || {_caller == _unit}) exitWith {_vehicle};

private _loadcar = nearestObject [_unit, "Car"];

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;
};
};
private _nearVehicles = nearestObjects [_unit, ["Car", "Air", "Tank", "Ship_F"], 10];

{
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
6 changes: 5 additions & 1 deletion addons/fastroping/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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 {
Expand Down
5 changes: 5 additions & 0 deletions addons/fastroping/script_component.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 5165db7

Please sign in to comment.