mirror of
https://github.com/godotengine/godot.git
synced 2025-10-21 08:53:35 +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:
parent
c41e4b10c3
commit
9ddebc0c22
23 changed files with 179 additions and 53 deletions
|
@ -1655,6 +1655,8 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p
|
|||
error_str += "Expected " + itos(r_error.argument) + " arguments.";
|
||||
} else if (r_error.error == Callable::CallError::CALL_ERROR_INVALID_METHOD) {
|
||||
error_str += "Invalid Call.";
|
||||
} else if (r_error.error == Callable::CallError::CALL_ERROR_METHOD_NOT_CONST) {
|
||||
error_str += "Method not const in a const instance.";
|
||||
} else if (r_error.error == Callable::CallError::CALL_ERROR_INSTANCE_IS_NULL) {
|
||||
error_str += "Base Instance is null";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue