-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling isActionPressed
on an InputEvent instance crashes Godot
#157
Comments
Note that calling |
There's an issue with reference handling in generated
As far as I can see, it expects the argument to be a pointer to
For some reason all refcounted objects get this wrapper in Generator:
I'm not sure if it's a general bug, or |
This also appears to happen for touch events, too: public override func _input(event: InputEvent) {
super._input(event: event)
if event.isClass("InputEventScreenTouch") {
LibAnthrobase.logger.debug("Received touch event: \(event)")
}
} |
Sadly the commit history does not point out the reason for that change (be78878), and I do not recall the reason for that. It was too early on the binding development, and might have been an artifact of the way things worked in 4.0 I added a bad workaround as well when I was working on the editor in a similar area (651645e), and even filed a bug to get back to try to figure out the proper fix (#109). I suspect the patch from @tishin is correct, and it should be much better than what we have now. The Godot-CPP bindings use this ref_get_object, but I struggle to find out where it is being used, due to the convoluted usage pattern (include/godot_cpp/classes/ref.hpp |
Ok, I have now verified that the C++ code does nothing with that binding code. So I think that this can go in, and I will also revert the other incorrect workaround. |
The text was updated successfully, but these errors were encountered: