Fix Area/Area2D mask matching
Created by: leonkrause
Currently, Area2DSW
has its non-existent BodyMode
checked like a Body2DSW
. This prevents, for example, performing raycasts only for Area2D
s.
This change has the relevant function return as soon as all checks needed for Area2DSW
are done.
Fixes #1906 (closed).
(Curiously, setting the object type mask to TYPE_MASK_AREA | TYPE_MASK_STATIC_BODY
works as a workaround to this bug — apparently calling get_mode()
on a Area2DSW
casted to a Body2DSW
returns TYPE_MASK_STATIC_BODY
? No idea what happens here…)