mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Add an event when a mine is detected to allow hooking into missions
This commit is contained in:
parent
244bdb093d
commit
6160fe076d
@ -35,10 +35,13 @@ if !([_unit, _type] call FUNC(isDetectorEnabled)) exitWith {
|
||||
if (ACE_player != _unit || {currentWeapon _unit != _type}) exitWith {};
|
||||
|
||||
private _detected = [[_unit, _detectorConfig], FUNC(getDetectedObject), _unit, QGVAR(detectedObjects), 0.15] call EFUNC(common,cachedCall);
|
||||
_detected params ["_hasDetected", "", "_distance"];
|
||||
_detected params ["_hasDetected", "_mine", "_distance"];
|
||||
|
||||
if (!_hasDetected) exitWith {};
|
||||
|
||||
// Launch a local event stating which mine was detected for mission purposes
|
||||
[QGVAR(mineDetected), [_unit, _mine, _distance]] call CBA_fnc_localEvent;
|
||||
|
||||
private _distanceTiming = switch (true) do {
|
||||
case (_distance >= 2): {1};
|
||||
case (_distance >= 1.25): {0.85};
|
||||
|
Loading…
Reference in New Issue
Block a user