From 00f35a3dae0b4be9377f813da0b6811c5125f566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brostr=C3=B6m=2EA=20=7C=20Evul?= Date: Sun, 30 Jan 2022 19:04:39 +0100 Subject: [PATCH] Cargo - Add ability to disabled rename on object level (#8740) * Rename can be disabled on object level - Added ability to stop renaming on object level _Needs testing_ * Fixed extra () * Forgot one of the ) * Update cargo-framework.md Co-authored-by: PabstMirror --- addons/cargo/XEH_postInit.sqf | 2 +- docs/wiki/framework/cargo-framework.md | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/addons/cargo/XEH_postInit.sqf b/addons/cargo/XEH_postInit.sqf index 6156cce1ac..b1e3493b11 100644 --- a/addons/cargo/XEH_postInit.sqf +++ b/addons/cargo/XEH_postInit.sqf @@ -101,7 +101,7 @@ GVAR(objectActions) = [ {(_target getVariable [QGVAR(canLoad), getNumber (configOf _target >> QGVAR(canLoad))]) in [true, 1]} && {alive _target} && {[_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)} && - {(getNumber ((configOf _target) >> QGVAR(noRename))) == 0} + {(_target getVariable [QGVAR(noRename), getNumber (configOf _target >> QGVAR(noRename))]) in [false, 0]} } ] call EFUNC(interact_menu,createAction), [QGVAR(load), localize LSTRING(loadObject), "a3\ui_f\data\IGUI\Cfg\Actions\loadVehicle_ca.paa", diff --git a/docs/wiki/framework/cargo-framework.md b/docs/wiki/framework/cargo-framework.md index 2baf9ebc9a..1bdb7716fd 100644 --- a/docs/wiki/framework/cargo-framework.md +++ b/docs/wiki/framework/cargo-framework.md @@ -28,8 +28,8 @@ class CfgVehicles { ### 1.2 Making an object loadable ```cpp -class staticBananaLauncher { - class yourVehicleBaseClass { +class CfgVehicles { + class staticBananaLauncher { 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) @@ -162,3 +162,9 @@ Note first arg can be a in-game object or a classname of an object type. * ["ACE_Wheel", vehicle, 2] call ace_cargo_fnc_removeCargoItem * [crate_7, truck] call ace_cargo_fnc_removeCargoItem ``` + +### 4.7 Disable cargo renaming via script + +```sqf +cargoBox setVariable ["ace_cargo_noRename", true] +```