From cc73036fd8bba8f10aadadf61a2f06fe41a51632 Mon Sep 17 00:00:00 2001 From: Julien Date: Sun, 19 Sep 2021 08:39:22 +0200 Subject: [PATCH] Fix #8 --- README.md | 2 +- addons/gearinfo/functions/fnc_applyTextureOptionOnItem.sqf | 6 ++++-- addons/main/script_version.hpp | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 611d60a..c116253 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ class XtdGearModels class A { texture = "path\to\texture.paa"; - // material = = "path\to\material.rvmat"; (default is "\a3\data_f\default.rvmat") + // material = "path\to\material.rvmat"; (if you use material on an option, you MUST set it on all options to avoid undefined behavior) }; // ... }; diff --git a/addons/gearinfo/functions/fnc_applyTextureOptionOnItem.sqf b/addons/gearinfo/functions/fnc_applyTextureOptionOnItem.sqf index 9e4e3a2..05cf7c3 100644 --- a/addons/gearinfo/functions/fnc_applyTextureOptionOnItem.sqf +++ b/addons/gearinfo/functions/fnc_applyTextureOptionOnItem.sqf @@ -29,7 +29,7 @@ if ( isText _hiddenselection ) then { if ( _hiddenSelectionIndex == -1 ) exitWith {}; private _texture = getText (_optionDefintion >> _value >> "texture"); -private _material = "\a3\data_f\default.rvmat"; +private _material = ""; if ( isText (_optionDefintion >> _value >> "material") ) then { _material = getText (_optionDefintion >> _value >> "material"); }; @@ -55,5 +55,7 @@ if ( _texture == "!INSIGNIA!" ) then { }; -_target setObjectMaterialGlobal [_hiddenSelectionIndex, _material]; +if ( _material != "" ) then { + _target setObjectMaterialGlobal [_hiddenSelectionIndex, _material]; +}; _target setObjectTextureGlobal [_hiddenSelectionIndex, _texture]; \ No newline at end of file diff --git a/addons/main/script_version.hpp b/addons/main/script_version.hpp index fe48a96..837a81f 100644 --- a/addons/main/script_version.hpp +++ b/addons/main/script_version.hpp @@ -1,4 +1,4 @@ #define MAJOR 0 #define MINOR 4 -#define PATCH 0 +#define PATCH 1 #define BUILD 0