Skip to content

Commit

Permalink
Disable damage for all cargo objects (#7946)
Browse files Browse the repository at this point in the history
  • Loading branch information
BaerMitUmlaut authored Oct 10, 2020
1 parent 56baf2b commit 4cfe26b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
6 changes: 1 addition & 5 deletions addons/cargo/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@
_item hideObjectGlobal false;
_item setPosASL (AGLtoASL _emptyPosAGL);

private _simulationType = toLower getText (configFile >> "CfgVehicles" >> typeOf _item >> "simulation");
if (_simulationType in ["carx", "tankx"]) then {
TRACE_1("re-enabling vehicle damage",_item);
[_item, "blockDamage", "ACE_cargo", false] call EFUNC(common,statusEffect_set);
};
[_item, "blockDamage", "ACE_cargo", false] call EFUNC(common,statusEffect_set);
}] call CBA_fnc_addEventHandler;

// Private events to handle adding actions globally via public functions
Expand Down
10 changes: 3 additions & 7 deletions addons/cargo/functions/fnc_loadItem.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,9 @@ if (_item isEqualType objNull) then {
detach _item;
_item attachTo [_vehicle,[0,0,-100]];
[QEGVAR(common,hideObjectGlobal), [_item, true]] call CBA_fnc_serverEvent;

// Cars below water will take engine damage over time and eventualy become "water logged" and unfixable (because of negative z attach)
private _simulationType = toLower getText (configFile >> "CfgVehicles" >> typeOf _item >> "simulation");
if (_simulationType in ["carx", "tankx"]) then {
TRACE_1("disabling vehicle damage",_item);
[_item, "blockDamage", "ACE_cargo", true] call EFUNC(common,statusEffect_set);
};

// Some objects below water will take damage over time and eventualy become "water logged" and unfixable (because of negative z attach)
[_item, "blockDamage", "ACE_cargo", true] call EFUNC(common,statusEffect_set);
};

true

0 comments on commit 4cfe26b

Please sign in to comment.