Skip to content
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

Fix mismatch between RigidBody2D and Body2DSW can_sleep defaults. #32767

Merged
merged 1 commit into from Oct 12, 2019

Conversation

@madmiraal
Copy link
Contributor

madmiraal commented Oct 12, 2019

Fixes #25099
This patch fixes the mismatch between the default can_sleep variables of RigidBody2D in scene/2d/physics_body_2d and Body2DSW in servers/physics2d/body_2d_sw. The expected behaviour is that RigidBody2D can_sleep is true; so the change is made to Body2DSW.

This issue was exposed during the change from 3.0 and 3.1 when saving and loading scenes was changed to only include nodes' non-default values. In 3.0 the default can_sleep value was set in Body2DSW when the scene was loaded, because it was specified in the RigidBody2D node's properties. In 3.1 the default can_sleep value is not set when the scene is loaded; so RigidBody2Ds do not sleep until the can_sleep property is set to true in a script.

@akien-mga akien-mga added this to the 3.2 milestone Oct 12, 2019
@akien-mga

This comment has been minimized.

Copy link
Member

akien-mga commented Oct 12, 2019

I guess the same is true for BodySW (3D)?

@madmiraal

This comment has been minimized.

Copy link
Contributor Author

madmiraal commented Oct 12, 2019

Yes. The same is true for BodySW. Shall I create a separate pull request or update this one?

@akien-mga

This comment has been minimized.

Copy link
Member

akien-mga commented Oct 12, 2019

Updating this one/amending the commit to fix both at the same time would be good.

- Set Body2DSW can_sleep default to true.

- Set Body2D can_sleep default to true.
@madmiraal madmiraal force-pushed the madmiraal:body2d-can_sleep-default branch from a8e2c93 to 42a9ae7 Oct 12, 2019
@akien-mga akien-mga merged commit 5d63cf1 into godotengine:master Oct 12, 2019
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@akien-mga

This comment has been minimized.

Copy link
Member

akien-mga commented Oct 12, 2019

Thanks!

@madmiraal madmiraal deleted the madmiraal:body2d-can_sleep-default branch Oct 12, 2019
@akien-mga

This comment has been minimized.

Copy link
Member

akien-mga commented Nov 12, 2019

Cherry-picked for 3.1.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.