You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-13 13:31:48 +00:00
Add a const call mode to Object, Variant and Script.
For this to work safely (user not call queue_free or something in the expression), a const call mode was added to Object and Variant (and optionally Script). This mode ensures only const functions can be called, making it safe to use from the editor. Co-Authored-By: reduz <reduzio@gmail.com>
This commit is contained in:
@@ -1474,7 +1474,7 @@ void CustomPropertyEditor::_modified(String p_string) {
|
||||
v = value_editor[0]->get_text().to_int();
|
||||
return;
|
||||
} else {
|
||||
v = expr->execute(Array(), nullptr, false);
|
||||
v = expr->execute(Array(), nullptr, false, false);
|
||||
}
|
||||
|
||||
if (v != prev_v) {
|
||||
@@ -1650,7 +1650,7 @@ real_t CustomPropertyEditor::_parse_real_expression(String text) {
|
||||
if (err != OK) {
|
||||
out = value_editor[0]->get_text().to_float();
|
||||
} else {
|
||||
out = expr->execute(Array(), nullptr, false);
|
||||
out = expr->execute(Array(), nullptr, false, true);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user