Dragging - Fix being able to load people into vehicles from any distance (#9638)

This commit is contained in:
Filip Maciejewski 2023-11-10 20:54:31 +01:00 committed by GitHub
parent 6bc5193a79
commit 7df63ffe2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

@ -75,12 +75,10 @@ private _hintLMB = LLSTRING(Drop);
getCursorObjectParams params ["_cursorObject", "", "_distance"];
if (
!isNull _cursorObject &&
{_distance < MAX_LOAD_DISTANCE} &&
{[_unit, _cursorObject, ["isNotCarrying"]] call EFUNC(common,canInteractWith)} &&
!isNull _cursorObject && {[_unit, _cursorObject, ["isNotCarrying"]] call EFUNC(common,canInteractWith)} &&
{
if (_target isKindOf "CAManBase") then {
[_cursorObject, 0, true] call EFUNC(common,nearestVehiclesFreeSeat) isNotEqualTo []
(_distance <= MAX_LOAD_DISTANCE_MAN) && {[_cursorObject, 0, true] call EFUNC(common,nearestVehiclesFreeSeat) isNotEqualTo []}
} else {
["ace_cargo"] call EFUNC(common,isModLoaded) &&
{[_target, _cursorObject] call EFUNC(cargo,canLoadItemIn)}

View File

@ -97,11 +97,13 @@ if (_mass != 0) then {
// Reset temp direction
_target setVariable [QGVAR(carryDirection_temp), nil];
private _cursorObject = cursorObject;
getCursorObjectParams params ["_cursorObject", "", "_distance"];
// Try loading into vehicle
if (_tryLoad && {!isNull _cursorObject} && {[_unit, _cursorObject, ["isNotCarrying"]] call EFUNC(common,canInteractWith)}) then {
if (_target isKindOf "CAManBase") then {
if (_distance > MAX_LOAD_DISTANCE_MAN) exitWith {};
private _vehicles = [_cursorObject, 0, true] call EFUNC(common,nearestVehiclesFreeSeat);
if ([_cursorObject] isEqualTo _vehicles) then {

View File

@ -16,7 +16,7 @@
#include "\z\ace\addons\main\script_macros.hpp"
#define MAX_LOAD_DISTANCE 5
#define MAX_LOAD_DISTANCE_MAN 5
#define DRAG_ANIMATIONS ["amovpercmstpslowwrfldnon_acinpknlmwlkslowwrfldb_2", "amovpercmstpsraswpstdnon_acinpknlmwlksnonwpstdb_2", "amovpercmstpsnonwnondnon_acinpknlmwlksnonwnondb_2", "acinpknlmstpsraswrfldnon", "acinpknlmstpsnonwpstdnon", "acinpknlmstpsnonwnondnon", "acinpknlmwlksraswrfldb", "acinpknlmwlksnonwnondb", "ace_dragging_rifle_limpb", "ace_dragging", "ace_dragging_limpb", "ace_dragging_static", "ace_dragging_drop"]
#define CARRY_ANIMATIONS ["acinpercmstpsnonwnondnon", "acinpknlmstpsnonwnondnon_acinpercmrunsnonwnondnon"]