summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript.cpp
diff options
context:
space:
mode:
authorYuri Sizov <11782833+YuriSizov@users.noreply.github.com>2023-06-22 12:51:03 +0200
committerGitHub <noreply@github.com>2023-06-22 12:51:03 +0200
commite74bf831c2d3ece79b849405f03999281f807648 (patch)
treecad517cf441dc49c7d88991d36b37cdecbc2a157 /modules/gdscript/gdscript.cpp
parent57e61db115909c062e6c9864cbd7aa44f2f64471 (diff)
parent84c894656522f0eb44ff971208ddded68dd1ea4b (diff)
downloadredot-engine-e74bf831c2d3ece79b849405f03999281f807648.tar.gz
Merge pull request #78549 from dalexeev/gds-fix-prop-list-name-check
GDScript: Remove unnecessary name check in `_get_property_list()`
Diffstat (limited to 'modules/gdscript/gdscript.cpp')
-rw-r--r--modules/gdscript/gdscript.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp
index 518b644af2..3d6d133579 100644
--- a/modules/gdscript/gdscript.cpp
+++ b/modules/gdscript/gdscript.cpp
@@ -1747,11 +1747,10 @@ void GDScriptInstance::get_property_list(List<PropertyInfo> *p_properties) const
Dictionary d = arr[i];
ERR_CONTINUE(!d.has("name"));
ERR_CONTINUE(!d.has("type"));
+
PropertyInfo pinfo;
- pinfo.type = Variant::Type(d["type"].operator int());
- ERR_CONTINUE(pinfo.type < 0 || pinfo.type >= Variant::VARIANT_MAX);
pinfo.name = d["name"];
- ERR_CONTINUE(pinfo.name.is_empty());
+ pinfo.type = Variant::Type(d["type"].operator int());
if (d.has("hint")) {
pinfo.hint = PropertyHint(d["hint"].operator int());
}
@@ -1765,6 +1764,9 @@ void GDScriptInstance::get_property_list(List<PropertyInfo> *p_properties) const
pinfo.class_name = d["class_name"];
}
+ ERR_CONTINUE(pinfo.name.is_empty() && (pinfo.usage & PROPERTY_USAGE_STORAGE));
+ ERR_CONTINUE(pinfo.type < 0 || pinfo.type >= Variant::VARIANT_MAX);
+
props.push_back(pinfo);
}
}