summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-06-11 11:22:55 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-06-11 11:22:55 +0200
commitdc1a6a190db4567744934672d0b1741db45d0445 (patch)
tree610dc0acea5bbbebcdef6ba93b84f168cf45211d
parent972839d12a5f86dfbe509d04f7a19f096e907f80 (diff)
parent94929439b6b61c624c0f5342ef7d4ae8d8a26c32 (diff)
downloadredot-engine-dc1a6a190db4567744934672d0b1741db45d0445.tar.gz
Merge pull request #93019 from akien-mga/revert-92350
Revert "Fix method name for custom callable"
-rw-r--r--core/object/undo_redo.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/core/object/undo_redo.cpp b/core/object/undo_redo.cpp
index 0f7884305a..4d67cd930e 100644
--- a/core/object/undo_redo.cpp
+++ b/core/object/undo_redo.cpp
@@ -159,11 +159,10 @@ void UndoRedo::add_do_method(const Callable &p_callable) {
do_op.ref = Ref<RefCounted>(Object::cast_to<RefCounted>(object));
}
do_op.type = Operation::TYPE_METHOD;
- // There's no `get_method()` for custom callables, so use `operator String()` instead.
- if (p_callable.is_custom()) {
+ do_op.name = p_callable.get_method();
+ if (do_op.name == StringName()) {
+ // There's no `get_method()` for custom callables, so use `operator String()` instead.
do_op.name = static_cast<String>(p_callable);
- } else {
- do_op.name = p_callable.get_method();
}
actions.write[current_action + 1].do_ops.push_back(do_op);
@@ -191,11 +190,10 @@ void UndoRedo::add_undo_method(const Callable &p_callable) {
}
undo_op.type = Operation::TYPE_METHOD;
undo_op.force_keep_in_merge_ends = force_keep_in_merge_ends;
- // There's no `get_method()` for custom callables, so use `operator String()` instead.
- if (p_callable.is_custom()) {
+ undo_op.name = p_callable.get_method();
+ if (undo_op.name == StringName()) {
+ // There's no `get_method()` for custom callables, so use `operator String()` instead.
undo_op.name = static_cast<String>(p_callable);
- } else {
- undo_op.name = p_callable.get_method();
}
actions.write[current_action + 1].undo_ops.push_back(undo_op);