From 610bd730531d862c7c3b303775a0012a51a3d63a Mon Sep 17 00:00:00 2001 From: Vigneshkumar Chinnachamy M Date: Thu, 28 May 2020 13:47:39 +0530 Subject: [PATCH] Fix #641 - Calling Body.setStatic(body, true) twice breaks the body --- src/body/Body.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/body/Body.js b/src/body/Body.js index f38d2c8..3b6efce 100644 --- a/src/body/Body.js +++ b/src/body/Body.js @@ -249,6 +249,11 @@ var Axes = require('../geometry/Axes'); Body.setStatic = function(body, isStatic) { for (var i = 0; i < body.parts.length; i++) { var part = body.parts[i]; + + if (part.isStatic === isStatic) { + continue; + } + part.isStatic = isStatic; if (isStatic) {