Add a way to block auto carry after unload on classes (#9013)

This commit is contained in:
Filip Maciejewski 2022-09-01 21:06:24 +02:00 committed by GitHub
parent c633a199b4
commit 3872eb0647
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

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

View File

@ -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
};
};
```