mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
switch from loadFile to preprocessFile and dusted off the regex brain cell
This commit is contained in:
parent
98fd580540
commit
1e93453963
@ -28,16 +28,17 @@ if !(isNil "_material") exitWith {
|
||||
if (isClass (configFile >> "CfgSurfaces" >> _surfType)) then {
|
||||
_material = getText (configFile >> "CfgSurfaces" >> _surfType >> "soundEnviron");
|
||||
} else { // Messy way when a surface isn't added to cfgSurfaces
|
||||
private _surfFileText = loadFile _surfType;
|
||||
_surfFileText = (tolower _surfFileText) splitString " "";="+ endl;
|
||||
private _idx = _surfFileText find "soundenviron";
|
||||
_material = _surfFileText#(_idx+1);
|
||||
if (_material isEqualTo "empty") then {
|
||||
_idx = _surfFileText find "soundhit";
|
||||
_material = _surfFileText#(_idx+1);
|
||||
};
|
||||
private _surfFileText = tolower preprocessFile _surfType;
|
||||
_surfFileText = _surfFileText regexReplace ["[^A-Za-z0-9]", ""];
|
||||
private _idx = 12 + (_surfFileText find "soundenviron");
|
||||
if (_surfFileText select [_idx, 5] isEqualTo "empty") then {
|
||||
_idx = 8 + (_surfFileText find "soundhit");
|
||||
_material = _surfFileText select [_idx, 10];
|
||||
} else {
|
||||
_material = _surfFileText select [_idx, 10];
|
||||
};
|
||||
};
|
||||
TRACE_1("soundFound",_material);
|
||||
TRACE_1("materialSubString",_material);
|
||||
|
||||
|
||||
_material = switch (true) do {
|
||||
|
Loading…
Reference in New Issue
Block a user