ACE3/addons/interaction/XEH_preStart.sqf
Dystopian 0c58d8b20b
Interaction - Add interaction with terrain objects (#8103)
* Add interaction with terrain objects

* Optimize with new commands

* Handle z-position under ground

* Add warning for setting

* Add parentheses to condition

Co-authored-by: jonpas <jonpas33@gmail.com>

* Add comments

* Add parentheses to condition

Co-authored-by: jonpas <jonpas33@gmail.com>

* Add parentheses to condition

Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com>

* Add replacement configs to dragging

This reverts commit afc5abe6cd.

* Fix validator error and optimize condition

Co-authored-by: jonpas <jonpas33@gmail.com>
Co-authored-by: mharis001 <34453221+mharis001@users.noreply.github.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2021-10-12 14:36:33 -05:00

26 lines
833 B
Plaintext

#include "script_component.hpp"
#include "XEH_PREP.hpp"
if (!hasInterface) exitWith {};
private _replaceTerrainClasses = QUOTE(
getNumber (_x >> QQGVAR(replaceTerrainObject)) > 0
&& {getNumber (_x >> 'scope') == 2}
) configClasses (configFile >> "CfgVehicles");
private _cacheReplaceTerrainModels = createHashMap;
{
private _model = toLower getText (_x >> "model");
if (_model select [0, 1] == "\") then {
_model = _model select [1];
};
if ((_model select [count _model - 4]) != ".p3d") then {
_model = _model + ".p3d"
};
if (_model in _cacheReplaceTerrainModels) then {continue};
_cacheReplaceTerrainModels set [_model, configName _x];
} forEach _replaceTerrainClasses;
uiNamespace setVariable [QGVAR(cacheReplaceTerrainModels), compileFinal str _cacheReplaceTerrainModels];