Merge pull request #27205 from Kanabenki/set-friction-bounce-check
Add missing check for 2d physics bounce and friction setters
This commit is contained in:
commit
a53645e726
|
@ -199,7 +199,7 @@ real_t StaticBody2D::get_constant_angular_velocity() const {
|
||||||
#ifndef DISABLE_DEPRECATED
|
#ifndef DISABLE_DEPRECATED
|
||||||
void StaticBody2D::set_friction(real_t p_friction) {
|
void StaticBody2D::set_friction(real_t p_friction) {
|
||||||
|
|
||||||
if (p_friction == 1.0) { // default value, don't create an override for that
|
if (p_friction == 1.0 && physics_material_override.is_null()) { // default value, don't create an override for that
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,7 +229,7 @@ real_t StaticBody2D::get_friction() const {
|
||||||
|
|
||||||
void StaticBody2D::set_bounce(real_t p_bounce) {
|
void StaticBody2D::set_bounce(real_t p_bounce) {
|
||||||
|
|
||||||
if (p_bounce == 0.0) { // default value, don't create an override for that
|
if (p_bounce == 0.0 && physics_material_override.is_null()) { // default value, don't create an override for that
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -626,7 +626,7 @@ real_t RigidBody2D::get_weight() const {
|
||||||
#ifndef DISABLE_DEPRECATED
|
#ifndef DISABLE_DEPRECATED
|
||||||
void RigidBody2D::set_friction(real_t p_friction) {
|
void RigidBody2D::set_friction(real_t p_friction) {
|
||||||
|
|
||||||
if (p_friction == 1.0) { // default value, don't create an override for that
|
if (p_friction == 1.0 && physics_material_override.is_null()) { // default value, don't create an override for that
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -655,7 +655,7 @@ real_t RigidBody2D::get_friction() const {
|
||||||
|
|
||||||
void RigidBody2D::set_bounce(real_t p_bounce) {
|
void RigidBody2D::set_bounce(real_t p_bounce) {
|
||||||
|
|
||||||
if (p_bounce == 0.0) { // default value, don't create an override for that
|
if (p_bounce == 0.0 && physics_material_override.is_null()) { // default value, don't create an override for that
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue