Operating system or device - Godot version:
Godot 2.1/HEAD, but it seems like master is somewhat affected too
Issue description:
While coding some stuff for a (non-FOSS) game, I named one of my methods as has_point
on a CanvasItem
-inheriting script that was assigned to some controls. I made it to return true
, since that was to be overriden by other scripts... And then, suddenly, all the controls with that script started grabbing all clicks :laughing:
I decided to search the docs, since I suspected something like this might have happened, but Control::has_point
wasn't listed, since it isn't bound at all.
Note that the has_point
implementation on scene/gui/control.cpp:572-588
calls the script method.
Steps to reproduce:
extends Control
func has_point(point):
return true
Link to minimal example project: Partly in a hurry here, so, maybe later on request.
How to fix:
scene/gui/control.cpp:2516
BIND_VMETHOD
macro, like here: scene/main/node.cpp:2923
BIND_VMETHOD(MethodInfo("_process", PropertyInfo(Variant::REAL, "delta")));
Control::has_point(Vector2 point)
I'd like to try this as my first contribution.
Also remove the regular bind_method
? Otherwise the ClassDB entries might contain duplicates which mess stuff up. (aka #7960)
Not sure about that though
Edit: I should learn to read. duh.
Fixed by #8023.
Most helpful comment
I'd like to try this as my first contribution.