Mine detection is all kinds of FUBAR..
nearestObject [player,"TimeBombCore"]
TimeBombCore will detect most explosives....
"APERSBoundingMine_Range_Ammo"
"APERSMine_Range_Ammo"
"APERSTripMine_Wire_Ammo"
"ATMine_Range_Ammo"
"ClaymoreDirectionalMine_Remote_Ammo"
"DemoCharge_Remote_Ammo"
"IEDLandBig_Remote_Ammo"
"IEDLandSmall_Remote_Ammo"
"IEDUrbanBig_Remote_Ammo"
"IEDUrbanSmall_Remote_Ammo"
"SatchelCharge_Remote_Mag"
"SLAMDirectionalMine_Wire_Ammo"
"UnderwaterMineAB_Range_Ammo",
"UnderwaterMine_Range_Ammo",
"UnderwaterMinePDM_Range_Ammo"
MineGeneric [ x, found, x, found, x, x, x, x, x, x, x, x, found, found, found ]
MineBase [ x, found, x, found, x, x, x, x, x, x, x, x, found, found, found ]
TimeBombCore [ found, x, found, x, found, found, found, found, found, found, found, found, x, x, x ]
Same order as listed above. Note the classes not detected by TimeBombCore, yet..
"APERSMine_Range_Ammo" isKindOf "TimeBombCore" //true
"TimeBombCore" in ([(configfile >> "CfgAmmo" >> "APERSMine_Range_Ammo"),true] call BIS_fnc_returnParents) //true
"ATMine_Range_Ammo" isKindOf "TimeBombCore" //true
"TimeBombCore" in ([(configfile >> "CfgAmmo" >> "ATMine_Range_Ammo"),true] call BIS_fnc_returnParents) //true
"UnderwaterMineAB_Range_Ammo" isKindOf "TimeBombCore" //true
"TimeBombCore" in ([(configfile >> "CfgAmmo" >> "UnderwaterMineAB_Range_Ammo"),true] call BIS_fnc_returnParents) //true
"UnderwaterMine_Range_Ammo" isKindOf "TimeBombCore" //true
"TimeBombCore" in ([(configfile >> "CfgAmmo" >> "UnderwaterMine_Range_Ammo"),true] call BIS_fnc_returnParents) //true
"UnderwaterMinePDM_Range_Ammo" isKindOf "TimeBombCore" //true
"TimeBombCore" in ([(configfile >> "CfgAmmo" >> "UnderwaterMinePDM_Range_Ammo"),true] call BIS_fnc_returnParents) //true
You could do something like...
_mines = [ nearestObject [ player, "MineBase" ], nearestObject [ player, "TimeBombCore" ] ];
_nearest = [ +_mines, [], { _x distanceSqr player }, "ASCEND", { !isNull _x } ] call BIS_fnc_sortBy select 0;
If you dont want to iterate allMines