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 for issue #917, Physics.P2.Body#addToWorld #925

Merged
merged 1 commit into from Jul 1, 2014

Conversation

jonkelling
Copy link
Contributor

Fix for issue #917: Calling reset() on Sprite with a P2 body can result in body.data.world == null.
Calling addToWorld() would previously not check the _toRemove array, which could, if the timing were right, result in a Sprite being revived but then removed from the P2 World--the result of this being the Sprite's data would be in a mixed state causing it to appear visually but not function in the world.

Fix for issue phaserjs#917: Calling reset() on Sprite with a P2 body can result in body.data.world == null.
Calling addToWorld() would previously not check the _toRemove array, which could, if the timing were right, result in a Sprite being revived but then removed from the P2 World--the result of this being the Sprite's data would be in a mixed state causing it to appear visually but not function in the world.
@photonstorm
Copy link
Collaborator

Damn... good catch, thank you!

photonstorm added a commit that referenced this pull request Jul 1, 2014
Fix for issue #917, Physics.P2.Body#addToWorld
@photonstorm photonstorm merged commit a425470 into phaserjs:dev Jul 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants