Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cargo - Fix loaded objects taking damage #7946

Merged
merged 1 commit into from
Oct 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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