From 03e11c13bfb1649fc9cf9a460249bce5e7f07462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 26 Jul 2018 17:25:00 +0200 Subject: [PATCH] Add check to clang 6.0 compiler bug workaround Extending on b68222e4e75d6cbe23c533f140733248df046c7e to ensure that it still has the exact same behaviour as the previous code, as discussed with @hpvb. --- servers/physics/collision_solver_sat.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/servers/physics/collision_solver_sat.cpp b/servers/physics/collision_solver_sat.cpp index 44b7c9ac34c..8f2b147460b 100644 --- a/servers/physics/collision_solver_sat.cpp +++ b/servers/physics/collision_solver_sat.cpp @@ -348,7 +348,9 @@ public: //use the smallest depth - min_B = -min_B; + if (min_B < 0.0) { // could be +0.0, we don't want it to become -0.0 + min_B = -min_B; + } if (max_B < min_B) { if (max_B < best_depth) {