Fix enum value increasing when duplicate.

This commit is contained in:
Tanasart 2024-11-02 11:13:45 +07:00
parent 9640608002
commit a1d7a867bb
2 changed files with 2 additions and 1 deletions

View file

@ -31,7 +31,7 @@ function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
var _val = nodeValue_Enum_Scroll("Light shape", self, 0, typeList); var _val = nodeValue_Enum_Scroll("Light shape", self, 0, typeList);
_val.options_histories = [ typeListStr, _val.options_histories = [ typeListStr,
{ {
cond: function() /*=>*/ {return LOADING_VERSION < 1_18_00_0}, cond: function() /*=>*/ {return LOADING_VERSION < 1_18_00_0 && !CLONING},
list: [ "Point", "Line", "Line asymmetric", "Spot" ] list: [ "Point", "Line", "Line asymmetric", "Spot" ]
} }
]; ];

View file

@ -25,6 +25,7 @@ function __NodeValue_Enum_Scroll(_name, _node, _value, _data) : NodeValue(_name,
static doApplyDeserialize = function() { static doApplyDeserialize = function() {
if(is_anim) return; if(is_anim) return;
if(CLONING) return;
if(array_empty(options_histories)) return; if(array_empty(options_histories)) return;
if(array_empty(animator.values)) return; if(array_empty(animator.values)) return;