From 3872eb0647df30a4e2a4490daa59db30221e7da2 Mon Sep 17 00:00:00 2001 From: Filip Maciejewski Date: Thu, 1 Sep 2022 21:06:24 +0200 Subject: [PATCH] Add a way to block auto carry after unload on classes (#9013) --- addons/cargo/functions/fnc_unloadCarryItem.sqf | 4 ++-- docs/wiki/framework/cargo-framework.md | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/cargo/functions/fnc_unloadCarryItem.sqf b/addons/cargo/functions/fnc_unloadCarryItem.sqf index 36985b5425..c12f12cb52 100644 --- a/addons/cargo/functions/fnc_unloadCarryItem.sqf +++ b/addons/cargo/functions/fnc_unloadCarryItem.sqf @@ -19,7 +19,7 @@ params ["_unloader", "_object"]; TRACE_2("unloadCarryItem-start",_unloader,_object); if !(["ace_dragging"] call EFUNC(common,isModLoaded)) exitWith {}; -if !(GVAR(carryAfterUnload)) exitWith {}; +if (!GVAR(carryAfterUnload) || {getNumber (configOf _object >> QGVAR(blockUnloadCarry)) > 0}) exitWith {}; // When unloading attached objects, this code will run before server has finished moving object to the safe position [{ @@ -36,5 +36,5 @@ if !(GVAR(carryAfterUnload)) exitWith {}; }; }, _this, 1.0, { // delay is based on how long it will take server event to trigger and take effect // not a hard error if this fails, could have just unloaded to other side of vehicle because of findSafePos - TRACE_1("unloadCarryItem-failed to unload nearby player",_this); + TRACE_1("unloadCarryItem-failed to unload nearby player",_this); }] call CBA_fnc_waitUntilAndExecute; diff --git a/docs/wiki/framework/cargo-framework.md b/docs/wiki/framework/cargo-framework.md index 1bdb7716fd..5b02f087be 100644 --- a/docs/wiki/framework/cargo-framework.md +++ b/docs/wiki/framework/cargo-framework.md @@ -33,6 +33,7 @@ class CfgVehicles { ace_cargo_size = 4; // Cargo space the object takes ace_cargo_canLoad = 1; // Enables the object to be loaded (1-yes, 0-no) ace_cargo_noRename = 1; // Blocks renaming object (1-blocked, 0-allowed) + ace_cargo_blockUnloadCarry = 1; // Blocks object from being automatically picked up by player on unload }; }; ```