Skip to content

Commit

Permalink
Explosives - Use triggerAmmo instead of setDamage (acemod#10182)
Browse files Browse the repository at this point in the history
* Use `triggerAmmo` instead of `setDamage`

* Update docs/wiki/framework/explosives-framework.md
  • Loading branch information
johnb432 authored and blake8090 committed Aug 18, 2024
1 parent 536130a commit e0b0fbc
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions addons/common/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ if (isServer) then {
[QGVAR(setVectorDirAndUp), {(_this select 0) setVectorDirAndUp (_this select 1)}] call CBA_fnc_addEventHandler;
[QGVAR(addWeaponItem), {(_this select 0) addWeaponItem [(_this select 1), (_this select 2)]}] call CBA_fnc_addEventHandler;
[QGVAR(removeMagazinesTurret), {(_this select 0) removeMagazinesTurret [_this select 1, _this select 2]}] call CBA_fnc_addEventHandler;
[QGVAR(triggerAmmo), {triggerAmmo _this}] call CBA_fnc_addEventHandler;

[QGVAR(setVanillaHitPointDamage), {
params ["_object", "_hitPointAnddamage"];
Expand Down
4 changes: 0 additions & 4 deletions addons/explosives/CfgAmmo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class CfgAmmo {
class DirectionalBombBase;
class ClaymoreDirectionalMine_Remote_Ammo: DirectionalBombBase {
GVAR(magazine) = "ClaymoreDirectionalMine_Remote_Mag";
GVAR(Explosive) = "ClaymoreDirectionalMine_Remote_Ammo_Scripted";
GVAR(size) = 0;
GVAR(defuseObjectPosition)[] = {0, 0, 0.038};
soundActivation[] = {"", 0, 0, 0};
Expand Down Expand Up @@ -92,7 +91,6 @@ class CfgAmmo {
class PipeBombBase;
class DemoCharge_Remote_Ammo: PipeBombBase {
GVAR(magazine) = "DemoCharge_Remote_Mag";
GVAR(Explosive) = "DemoCharge_Remote_Ammo_Scripted"; // can probably remove as base ammo now has triggerWhenDestroyed
GVAR(size) = 0;
GVAR(defuseObjectPosition)[] = {0.07, 0, 0.055};
soundActivation[] = {"", 0, 0, 0};
Expand All @@ -103,7 +101,6 @@ class CfgAmmo {
};
class SatchelCharge_Remote_Ammo: PipeBombBase {
GVAR(magazine) = "SatchelCharge_Remote_Mag";
GVAR(Explosive) = "SatchelCharge_Remote_Ammo_Scripted"; // can probably remove as base ammo now has triggerWhenDestroyed
GVAR(size) = 0;
GVAR(defuseObjectPosition)[] = {0.1, 0.1, 0.05};
soundActivation[] = {"", 0, 0, 0};
Expand Down Expand Up @@ -171,7 +168,6 @@ class CfgAmmo {
// Orange DLC:
class APERSMineDispenser_Ammo: PipeBombBase {
GVAR(magazine) = "APERSMineDispenser_Mag";
GVAR(Explosive) = "APERSMineDispenser_Ammo_Scripted"; // triggerWhenDestroyed = 1;
GVAR(size) = 0;
GVAR(defuseObjectPosition)[] = {0.0, -0.05, 0.15};
};
Expand Down
2 changes: 1 addition & 1 deletion addons/explosives/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if (isServer) then {
params ["_explosive"];
TRACE_1("exploding",_explosive);
if (!isNull _explosive) then {
_explosive setDamage 1;
[QEGVAR(common,triggerAmmo), _explosive, _explosive] call CBA_fnc_targetEvent;
};
}, _explosive, _delay] call CBA_fnc_waitAndExecute;
}] call CBA_fnc_addEventHandler;
Expand Down
2 changes: 1 addition & 1 deletion docs/wiki/framework/explosives-framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class CfgAmmo {
class SatchelCharge_Remote_Ammo: PipeBombBase {
soundActivation[] = {"", 0, 0, 0}; // No sound on activation
soundDeactivation[] = {"", 0, 0, 0}; // No sound on deactivation
triggerWhenDestroyed = 1; // (Optional) Explode when the object is shot and destroyed (after being placed) (0-disabled, 1-enabled).
triggerWhenDestroyed = 1; // (Optional) Explode when the object is shot and destroyed (after being placed) (0-disabled, 1-enabled). Required to be enabled prior to ACE 3.18.0.
ACE_explodeOnDefuse = 0.02; // (Optional) Add a chance for the explosive to detonate after being disarmed (in percent)
ACE_explosives_defuseObjectPosition[] = {-1.415, 0, 0.12}; // (Optional) The position relative to the model where the defuse helper object will be attached and thus the interaction point will be rendered
ACE_explosives_size = 0; // (Optional) Setting to 1 will use a defusal action with a larger radius (useful for large mines or mines with a wide pressure plane trigger area)
Expand Down

0 comments on commit e0b0fbc

Please sign in to comment.