Skip to content

Commit

Permalink
Cargo - Add ability to disabled rename on object level (#8740)
Browse files Browse the repository at this point in the history
* 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 <pabstmirror@gmail.com>
  • Loading branch information
AndreasBrostrom and PabstMirror authored Jan 30, 2022
1 parent f21a5e4 commit 00f35a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion addons/cargo/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 8 additions & 2 deletions docs/wiki/framework/cargo-framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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]
```

0 comments on commit 00f35a3

Please sign in to comment.