Skip to content

Commit

Permalink
Revert "Fix method name for custom callable"
Browse files Browse the repository at this point in the history
This reverts commit e88095e.

Fixes godotengine#92695.
  • Loading branch information
akien-mga authored and chryan committed Aug 6, 2024
1 parent 05cc07c commit 8075a64
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions core/object/undo_redo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 8075a64

Please sign in to comment.