From e48012e1041c7e686e8899d057a6f44677f007a3 Mon Sep 17 00:00:00 2001 From: BaerMitUmlaut Date: Tue, 6 Oct 2020 09:12:51 +0200 Subject: [PATCH] Disable damage for all cargo objects --- addons/cargo/XEH_postInit.sqf | 6 +----- addons/cargo/functions/fnc_loadItem.sqf | 10 +++------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/addons/cargo/XEH_postInit.sqf b/addons/cargo/XEH_postInit.sqf index decaf1637c9..7ea978dc73c 100644 --- a/addons/cargo/XEH_postInit.sqf +++ b/addons/cargo/XEH_postInit.sqf @@ -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 diff --git a/addons/cargo/functions/fnc_loadItem.sqf b/addons/cargo/functions/fnc_loadItem.sqf index 96dcaf87f13..f69996c1d4c 100644 --- a/addons/cargo/functions/fnc_loadItem.sqf +++ b/addons/cargo/functions/fnc_loadItem.sqf @@ -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