Fix operator precedence in PhysicsBody2D::set_weight

Fixes #16038.
This commit is contained in:
Rémi Verschelde 2018-08-29 08:37:08 +02:00
parent 6fcc20ec51
commit 3b01bf94ad
1 changed files with 2 additions and 2 deletions

View File

@ -598,12 +598,12 @@ real_t RigidBody2D::get_inertia() const {
void RigidBody2D::set_weight(real_t p_weight) { 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 { 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 #ifndef DISABLE_DEPRECATED