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

Explosives - Add getVar to disable setShotParents #9190

Merged
merged 2 commits into from
May 3, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions addons/explosives/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
_this call FUNC(setPosition);

if (isServer) then {
_explosive setShotParents [_unit, _unit];
if (missionNamespace getVariable [QGVAR(setShotParents), true]) then {
_explosive setShotParents [_unit, _unit];
};
};
}] call CBA_fnc_addEventHandler;
[QGVAR(startDefuse), FUNC(startDefuse)] call CBA_fnc_addEventHandler;
Expand All @@ -33,7 +35,9 @@ if (isServer) then {
[QGVAR(detonate), {
params ["_unit", "_explosive", "_delay"];
TRACE_3("server detonate EH",_unit,_explosive,_delay);
_explosive setShotParents [_unit, _unit];
if (missionNamespace getVariable [QGVAR(setShotParents), true]) then {
_explosive setShotParents [_unit, _unit];
};
[{
params ["_explosive"];
TRACE_1("exploding",_explosive);
Expand Down
9 changes: 9 additions & 0 deletions docs/wiki/framework/explosives-framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,12 @@ Jammer that blocks RF triggers:
true
}] call ace_explosives_fnc_addDetonateHandler;
```

#### 5.4 Disabling `setShotParents`.

ACE will set the owner/instigator of the explosive to the unit placeing/detonating it.
This can be disabled by executing

```sqf
ace_explosives_setShotParents = false;
```