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 - Use EFUNC(common,canDig) #10558

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions addons/explosives/functions/fnc_placeExplosive.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,11 @@ _triggerSpecificVars pushBack _triggerConfig;
if (isNumber (_magazineTrigger >> "digDistance")) then {
private _digDistance = getNumber (_magazineTrigger >> "digDistance");

//Get Surface Type:
private _canDigDown = true;

// If dig distance is negative (=> placed closer towards the sky), ignore digging requirements
if (_digDistance < 0) then {
private _surfaceType = surfaceType _pos;
if ((_surfaceType select [0,1]) == "#") then {_surfaceType = _surfaceType select [1, 99];};
if ((_surfaceType != "") || {isClass (configFile >> "CfgSurfaces" >> _surfaceType >> "soundEnviron")}) then {
private _soundEnviron = getText (configFile >> "CfgSurfaces" >> _surfaceType >> "soundEnviron");
TRACE_2("Dig Down Surface",_surfaceType,_soundEnviron);
_canDigDown = !(_soundEnviron in ["road", "tarmac", "concrete", "concrete_int", "int_concrete", "concrete_ext"]);
};
private _canDigDown = if (_digDistance >= 0) then {
[_pos] call EFUNC(common,canDig)
} else {
true
};

//Don't dig down if pos ATL is high (in a building or A2 road)
Expand Down
Loading