Skip to content

Commit 0fa0ca0

Browse files
committed
Remove storage usage from properties with getter
1 parent af8dd13 commit 0fa0ca0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/script-language/LuaScriptProperty.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static LuaScriptProperty lua_property(sol::stack_object value) {
3434
property.usage = PROPERTY_USAGE_STORAGE;
3535

3636
if (auto table = value.as<sol::optional<sol::stack_table>>()) {
37-
// 1: either a Variant type or the default value
37+
// index 1: either a Variant type or the default value
3838
if (auto type = table->get<sol::optional<VariantType>>(1)) {
3939
property.type = type->get_type();
4040
}
@@ -65,9 +65,11 @@ static LuaScriptProperty lua_property(sol::stack_object value) {
6565
}
6666
if (auto getter_name = table->get<sol::optional<StringName>>("get")) {
6767
property.getter_name = *getter_name;
68+
property.usage &= ~PROPERTY_USAGE_STORAGE;
6869
}
6970
else if (auto getter = table->get<sol::optional<sol::protected_function>>("get")) {
7071
property.getter = getter;
72+
property.usage &= ~PROPERTY_USAGE_STORAGE;
7173
}
7274
if (auto setter_name = table->get<sol::optional<StringName>>("set")) {
7375
property.setter_name = *setter_name;
@@ -82,6 +84,7 @@ static LuaScriptProperty lua_property(sol::stack_object value) {
8284
else {
8385
property.default_value = to_variant(value);
8486
}
87+
8588
if (property.type == 0) {
8689
property.type = property.default_value.get_type();
8790
}

0 commit comments

Comments
 (0)