Added config params for white/blacklisting digging (#5898)

* Added config params for white/blacklisting digging

* changed to canDig option

* Update README.md

* Update fnc_canDig.sqf
This commit is contained in:
Christian Klemm 2017-12-20 22:41:50 +01:00 committed by PabstMirror
parent 801afb3061
commit ead5fb4a5e
2 changed files with 19 additions and 3 deletions

View File

@ -24,8 +24,14 @@ if ((getPosATL _unit) select 2 > 0.05 || // Walking on objects, such as building
) exitWith {false};
private _surfaceClass = (surfaceType _posASL) select [1];
private _surfaceType = getText (configFile >> "CfgSurfaces" >> _surfaceClass >> "soundEnviron");
private _surfaceDust = getNumber (configFile >> "CfgSurfaces" >> _surfaceClass >> "dust");
private _config = configFile >> "CfgSurfaces" >> _surfaceClass;
private _surfaceType = getText (_config >> "soundEnviron");
private _surfaceDust = getNumber (_config >> "dust");
TRACE_2("Surface",_surfaceType,_surfaceDust);
!(_surfaceType in DIG_SURFACE_BLACKLIST) && {(_surfaceDust >= 0.1) || {_surfaceType in DIG_SURFACE_WHITELIST}}
if (isNumber (_config >> "ACE_canDig")) then {
getNumber (_config >> "ACE_canDig") // return
} else {
!(_surfaceType in DIG_SURFACE_BLACKLIST) && {(_surfaceDust >= 0.1) || {_surfaceType in DIG_SURFACE_WHITELIST}} // return
};

View File

@ -4,6 +4,16 @@ ace_trenches
Adds item 'ACE_entrenchingtool'
Adds 2 trenches; Envelope - Small & Envelop - Big
### Whitelist surfaces for digging
Single surfaces can be whitelisted by adding `ACE_canDig = 1` into `CfgSurfaces`.
Example:
```cpp
class CfgSurfaces {
class myAwesomeSurface {
ACE_canDig = 1;
};
};
```
## Maintainers