Merge pull request #25282 from akien-mga/physicsbody-friction-default
Fix PhysicsBody ignoring deprecated set_friction/bounce with default value
This commit is contained in:
commit
fb9c83780d
1 changed files with 4 additions and 4 deletions
|
@ -188,7 +188,7 @@ PhysicsBody::PhysicsBody(PhysicsServer::BodyMode p_mode) :
|
||||||
#ifndef DISABLE_DEPRECATED
|
#ifndef DISABLE_DEPRECATED
|
||||||
void StaticBody::set_friction(real_t p_friction) {
|
void StaticBody::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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ real_t StaticBody::get_friction() const {
|
||||||
|
|
||||||
void StaticBody::set_bounce(real_t p_bounce) {
|
void StaticBody::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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -632,7 +632,7 @@ real_t RigidBody::get_weight() const {
|
||||||
#ifndef DISABLE_DEPRECATED
|
#ifndef DISABLE_DEPRECATED
|
||||||
void RigidBody::set_friction(real_t p_friction) {
|
void RigidBody::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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -661,7 +661,7 @@ real_t RigidBody::get_friction() const {
|
||||||
|
|
||||||
void RigidBody::set_bounce(real_t p_bounce) {
|
void RigidBody::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 a new issue