summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2018-08-29 08:37:08 +0200
committerRémi Verschelde <rverschelde@gmail.com>2018-08-29 08:37:08 +0200
commit3b01bf94adb2412a2af5c5e17bbf71e320af37c1 (patch)
treea424bd87015e8b7e9636c454ee2fb41bf8b8021f
parent6fcc20ec5116a77c2328f4406a258527cc1aad5e (diff)
Fix operator precedence in PhysicsBody2D::set_weight
Fixes #16038.
-rw-r--r--scene/2d/physics_body_2d.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp
index 8e31688d90..bd2253809c 100644
--- a/scene/2d/physics_body_2d.cpp
+++ b/scene/2d/physics_body_2d.cpp
@@ -598,12 +598,12 @@ real_t RigidBody2D::get_inertia() const {
void RigidBody2D::set_weight(real_t p_weight) {
- set_mass(p_weight / real_t(GLOBAL_DEF("physics/2d/default_gravity", 98)) / 10);
+ set_mass(p_weight / (real_t(GLOBAL_DEF("physics/2d/default_gravity", 98)) / 10));
}
real_t RigidBody2D::get_weight() const {
- return mass * real_t(GLOBAL_DEF("physics/2d/default_gravity", 98)) / 10;
+ return mass * (real_t(GLOBAL_DEF("physics/2d/default_gravity", 98)) / 10);
}
#ifndef DISABLE_DEPRECATED