1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +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:
K. S. Ernest (iFire) Lee
2022-06-27 13:10:04 -07:00
parent c41e4b10c3
commit 9ddebc0c22
23 changed files with 179 additions and 53 deletions

View File

@@ -295,6 +295,11 @@ void ScriptServer::save_global_classes() {
}
////////////////////
Variant ScriptInstance::call_const(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) {
return callp(p_method, p_args, p_argcount, r_error);
}
void ScriptInstance::get_property_state(List<Pair<StringName, Variant>> &state) {
List<PropertyInfo> pinfo;
get_property_list(&pinfo);