Skip to content

Commit

Permalink
Update OnMouseDown to set Blok as dynamic before returning
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Silverman committed Jan 12, 2025
1 parent ed41227 commit 816606e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Physics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,10 @@ Blok *Physics::OnMouseDown(b2Vec2 p)
b2Joint_SetCollideConnected(m_mouseJoint, true);
b2Body_SetAwake(m_callbackBody, true);

return (Blok *)b2Body_GetUserData(m_callbackBody);
Blok *blok = (Blok *)b2Body_GetUserData(m_callbackBody);
blok->SetStatic(false);

return blok;
}

return NULL;
Expand Down

0 comments on commit 816606e

Please sign in to comment.