From 13fc4da86e788eb811510d7f3c101aad86a471c2 Mon Sep 17 00:00:00 2001 From: Salbei Date: Fri, 7 Dec 2018 08:57:56 +0100 Subject: [PATCH] Fixed all open issues --- .../functions/fnc_getSurfaceTexturePath.sqf | 5 ----- addons/trenches/functions/fnc_initTrench.sqf | 14 +++++++------- addons/trenches/functions/fnc_placeConfirm.sqf | 2 +- addons/trenches/stringtable.xml | 12 ++++++------ 4 files changed, 14 insertions(+), 19 deletions(-) diff --git a/addons/trenches/functions/fnc_getSurfaceTexturePath.sqf b/addons/trenches/functions/fnc_getSurfaceTexturePath.sqf index 6ba3abc9064..a4f02cd6f40 100644 --- a/addons/trenches/functions/fnc_getSurfaceTexturePath.sqf +++ b/addons/trenches/functions/fnc_getSurfaceTexturePath.sqf @@ -58,9 +58,4 @@ private _result = if !(isNil QGVAR(automaticFileSetup)) then { [_surfaceType, _basePath, getText(configFile >> "CfgWorlds" >> worldName >> "filePrefix")] call _getTexturePath; }; -if !(_result isEqualType "") then { - diag_log format ["GRAD_Trenches: Type: %1, Position: %2, WorldName: %3, SurfaceType: %4, Texture: %5", (typeof _object), (position _object), worldName, _surfaceType, _result]; - _result = DEFAULT_TEXTURE; -}; - _result; diff --git a/addons/trenches/functions/fnc_initTrench.sqf b/addons/trenches/functions/fnc_initTrench.sqf index 84c2c2c689f..72e973c561c 100644 --- a/addons/trenches/functions/fnc_initTrench.sqf +++ b/addons/trenches/functions/fnc_initTrench.sqf @@ -16,20 +16,20 @@ */ params [ - ["_object", objNull, [objNull]] + ["_object", objNull, [objNull]] ]; if (isServer) then { _object setVariable [QGVAR(progress), 1, true]; }; if (is3DEN) exitWith { - [_object] call FUNC(initTrench3DEN); + [_object] call FUNC(initTrench3DEN); }; if (local _object) then { - // Has to be spawned to ensure MP compatibility - _object spawn { - private _texture = [_this] call FUNC(getSurfaceTexturePath); - _this setObjectTextureGlobal [0, _texture]; - }; + // Has to be spawned to ensure MP compatibility + [{ + private _texture = [_this select 0] call FUNC(getSurfaceTexturePath); + (_this select 0) setObjectTextureGlobal [0, _texture]; + }, [_this]] call CBA_fnc_execNextFrame; }; diff --git a/addons/trenches/functions/fnc_placeConfirm.sqf b/addons/trenches/functions/fnc_placeConfirm.sqf index df67cf619d8..15e4fd59430 100644 --- a/addons/trenches/functions/fnc_placeConfirm.sqf +++ b/addons/trenches/functions/fnc_placeConfirm.sqf @@ -49,7 +49,7 @@ _lbfc params ["", "", "_lbfcZ"]; _rtbc params ["", "", "_rtbcZ"]; private _boundingBoxOffset = missionNamespace getVariable [getText (configFile >> "CfgVehicles" >> _trenchClass >> QGVAR(boundingBoxOffset)),0]; -private _posDiff = (abs(_lbfcZ) + abs(_rtbcZ)) - _boundingBoxOffset; +private _posDiff = abs _lbfcZ + abs _rtbcZ - _boundingBoxOffset; private _newPos = _trench modelToWorldWorld [0,0, -_posDiff]; _trench setPosWorld _newPos; diff --git a/addons/trenches/stringtable.xml b/addons/trenches/stringtable.xml index a99f8c32aa8..efb83313a34 100644 --- a/addons/trenches/stringtable.xml +++ b/addons/trenches/stringtable.xml @@ -247,8 +247,8 @@ Убираю камуфляж окопа... - Envelope - Giant - Rund - Sehr groß + Trench (Envelope - Giant) + Schützengraben (Rund - Sehr groß) Огромный окоп @@ -272,8 +272,8 @@ Применить камуфляж к этому окопу - Envelope - Vehicle - Rund - Fahrzeug + Trench (Envelope - Vehicle) + Schützengraben (Rund - Fahrzeug) Окоп для техники @@ -287,8 +287,8 @@ Выкопать окоп для техники - Envelope - Short - Rund - Kurz + Trench (Envelope - Short) + Schützengraben (Rund - Kurz) Короткий окоп