mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
fix mine detector not picking up fused explosives
This commit is contained in:
parent
66450ad36a
commit
5f52101b26
30
addons/minedetector/CfgAmmo.hpp
Normal file
30
addons/minedetector/CfgAmmo.hpp
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
class CfgAmmo {
|
||||||
|
|
||||||
|
// seems to not get inherited
|
||||||
|
class Default;
|
||||||
|
class TimeBombCore: Default {
|
||||||
|
GVAR(detectable) = 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
// these below do get inherited
|
||||||
|
class DirectionalBombCore;
|
||||||
|
class DirectionalBombBase: DirectionalBombCore {
|
||||||
|
GVAR(detectable) = 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
class BoundingMineCore;
|
||||||
|
class BoundingMineBase: BoundingMineCore {
|
||||||
|
GVAR(detectable) = 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
class MineCore;
|
||||||
|
class MineBase: MineCore {
|
||||||
|
GVAR(detectable) = 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
class PipeBombCore;
|
||||||
|
class PipeBombBase: PipeBombCore {
|
||||||
|
GVAR(detectable) = 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
@ -5,6 +5,6 @@ ADDON = false;
|
|||||||
#include "XEH_PREP.hpp"
|
#include "XEH_PREP.hpp"
|
||||||
|
|
||||||
// TODO load from config instead of hardcoded in sqf
|
// TODO load from config instead of hardcoded in sqf
|
||||||
GVAR(ALL_DETECTABLE_TYPES) = ["ACE_Explosive_Object", "ACE_Explosive_Helper", "ACE_Explosives_Place", "ModuleMine_F", "MineBase"];
|
GVAR(ALL_DETECTABLE_TYPES) = ["ACE_Explosive_Object", "ACE_Explosive_Helper", "ACE_Explosives_Place", "ModuleMine_F", "TimeBombCore", "MineBase", "DirectionalBombBase", "BoundingMineBase", "PipeBombBase"];
|
||||||
|
|
||||||
ADDON = true;
|
ADDON = true;
|
||||||
|
@ -15,6 +15,7 @@ class CfgPatches {
|
|||||||
|
|
||||||
#include "CfgEventHandlers.hpp"
|
#include "CfgEventHandlers.hpp"
|
||||||
#include "CfgWeapons.hpp"
|
#include "CfgWeapons.hpp"
|
||||||
|
#include "CfgAmmo.hpp"
|
||||||
#include "CfgVehicles.hpp"
|
#include "CfgVehicles.hpp"
|
||||||
#include "CfgSounds.hpp"
|
#include "CfgSounds.hpp"
|
||||||
#include "ACE_detector.hpp"
|
#include "ACE_detector.hpp"
|
||||||
|
@ -27,10 +27,10 @@ private _direction = _unit weaponDirection "Put";
|
|||||||
|
|
||||||
private _detectorPointAGL = _worldPosition vectorAdd (_direction vectorMultiply __DR);
|
private _detectorPointAGL = _worldPosition vectorAdd (_direction vectorMultiply __DR);
|
||||||
|
|
||||||
private _mines = nearestObjects [_detectorPointAGL, _detectableTypes, _radius];
|
private _nearestObjects = nearestObjects [_detectorPointAGL, [], _radius];
|
||||||
|
|
||||||
#ifdef DEBUG_MODE_FULL
|
#ifdef DEBUG_MODE_FULL
|
||||||
GVAR(debugDetector) = [_detectorPointAGL, _mines];
|
GVAR(debugDetector) = [_detectorPointAGL, _nearestObjects];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private _isDetectable = false;
|
private _isDetectable = false;
|
||||||
@ -38,15 +38,24 @@ private _mine = objNull;
|
|||||||
private _distance = -1;
|
private _distance = -1;
|
||||||
|
|
||||||
{
|
{
|
||||||
//Try all mines in range and use first detectable one:
|
private _object = _x;
|
||||||
|
|
||||||
|
if ({_object isKindOf _x} count _detectableTypes > 0) then {
|
||||||
|
//Try all unprepared mines in range and use first detectable one:
|
||||||
if ((getNumber (configFile >> "CfgVehicles" >> (typeOf _x) >> QGVAR(detectable))) == 1) exitWith {
|
if ((getNumber (configFile >> "CfgVehicles" >> (typeOf _x) >> QGVAR(detectable))) == 1) exitWith {
|
||||||
_isDetectable = true;
|
_isDetectable = true;
|
||||||
_mine = _x;
|
_mine = _x;
|
||||||
_distance = _detectorPointAGL distance _x;
|
_distance = _detectorPointAGL distance _x;
|
||||||
};
|
};
|
||||||
nil
|
//Try all prepared mines in range and use first detectable one:
|
||||||
} count _mines;
|
if ((getNumber (configFile >> "CfgAmmo" >> (typeOf _x) >> QGVAR(detectable))) == 1) exitWith {
|
||||||
|
_isDetectable = true;
|
||||||
|
_mine = _x;
|
||||||
|
_distance = _detectorPointAGL distance _x;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
} forEach _nearestObjects;
|
||||||
|
|
||||||
TRACE_3("return",_isDetectable, _mine, _distance);
|
TRACE_3("return",_isDetectable,_mine,_distance);
|
||||||
|
|
||||||
[_isDetectable, _mine, _distance];
|
[_isDetectable, _mine, _distance];
|
||||||
|
Loading…
Reference in New Issue
Block a user