You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm building snopek games' sg_physics_2d module with godot 3.5, and this bit of C++ code
// From sg_physics_2d_server.h
RID collision_object_create(CollisionObjectType p_object_type, BodyType p_body_type = BODY_UNKNOWN);
// From sg_physics_2d_server.cppClassDB::bind_method(D_METHOD("collision_object_create", "object_type", "body_type"), &SGPhysics2DServer::collision_object_create, DEFVAL(BODY_UNKNOWN));
gets converted into
/// <summary>/// <para>Creates a collision object.</para>/// </summary>[GodotMethod("collision_object_create")]publicstaticRIDCollisionObjectCreate(SGPhysics2DServer.CollisionObjectTypeobjectType,SGPhysics2DServer.BodyTypebodyType=(SGPhysics2DServer.BodyType)-1){returnnewRID(NativeCalls.godot_icall_2_881(method_bind_12,ptr,(int)objectType,(int)bodyType));}
Note that BODY_UNKNOWN is an enum value that evaluates to -1. Notice how there are no parentheses around the -1 in C# code, leading to a compiler error. Instead of (SGPhysics2DServer.BodyType)-1, it should be (SGPhysics2DServer.BodyType)(-1)
Godot version
3.5.1, though it may also affect later versions
System information
Windows 11
Issue description
I'm building snopek games' sg_physics_2d module with godot 3.5, and this bit of C++ code
gets converted into
Note that BODY_UNKNOWN is an enum value that evaluates to -1. Notice how there are no parentheses around the -1 in C# code, leading to a compiler error. Instead of
(SGPhysics2DServer.BodyType)-1
, it should be(SGPhysics2DServer.BodyType)(-1)
Steps to reproduce
N/A
Minimal reproduction project
See snopek games' sg-physics-2d repository
The text was updated successfully, but these errors were encountered: