fixes to worldObjectType function

This commit is contained in:
vbawol 2017-06-06 08:13:36 -05:00
parent c887028d9b
commit 784bb3d7f3

View File

@ -31,33 +31,25 @@ _config = ('CfgEpochClient' call EPOCH_returnConfig) >> "CfgWorldInteractions";
_selectedConfig = ""; _selectedConfig = "";
if (_object isEqualType objNull) then { if (_object isEqualType objNull) then {
if !(_object isKindOf "All") then { if !(_object isKindOf "All") then {
_modelInfo = getModelInfo _object; _modelInfo = getModelInfo _object;
_p3dName = _modelInfo select 0;
// replace spaces and periods with underscores // replace spaces and periods with underscores
(_p3dName splitString " .") joinString "_"; _selectedConfig = ((_modelInfo select 0) splitString " .") joinString "_";
_selectedConfig = _p3dName;
} else { } else {
_selectedConfig = typeOf _object; _selectedConfig = typeOf _object;
}; };
} else { } else {
// find start of p3d name - OLD UNUSED TBR // find start of p3d name - OLD UNUSED TBR
_findStart = _object find ": "; if (_object isEqualType "") then {
if (_findStart != -1) then{ _findStart = _object find ": ";
_start = _findStart + 2; if (_findStart != -1) then{
_end = (_object find ".") - _start; _start = _findStart + 2;
_p3dName = _object select[_start, _end]; // replace spaces and periods with underscores
// replace spaces with underscores _selectedConfig = ((_object select [_start]) splitString " .") joinString "_";
if (_p3dName find " " != -1) then {
(_p3dName splitString " ") joinString "_";
}; };
_selectedConfig = _p3dName + "_p3d";
}; };
}; };
// Do checks // Do checks
_finalConfig = (_config >> _selectedConfig); _finalConfig = (_config >> _selectedConfig);
if (_checkType isEqualType []) then { if (_checkType isEqualType []) then {