diff options
author | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2021-11-09 15:30:15 -0700 |
---|---|---|
committer | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2021-11-10 08:27:33 -0700 |
commit | bfd0d33244f565ffca17b0578edc3a82b76a7204 (patch) | |
tree | 79892900a07fb3538d64587e052045d10ecd1c3f /doc | |
parent | e8870ddefc36f6e04dc6212ab5ca1d6391739539 (diff) |
Fix errors in CharacterBody when floor is destroyed or removed
In all physics servers, body_get_direct_state() now silently returns
nullptr when the body has been already freed or is removed from space,
so the client code can detect this state and invalidate the body rid.
In 2D, there is no change in behavior (just no more errors).
In 3D, the Bullet server returned a valid direct body state when the
body was removed from the physics space, but in this case it didn't
make sense to use the information from the body state.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/PhysicsServer2D.xml | 2 | ||||
-rw-r--r-- | doc/classes/PhysicsServer3D.xml | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/doc/classes/PhysicsServer2D.xml b/doc/classes/PhysicsServer2D.xml index 7368fe06ab..6f88707259 100644 --- a/doc/classes/PhysicsServer2D.xml +++ b/doc/classes/PhysicsServer2D.xml @@ -346,7 +346,7 @@ <return type="PhysicsDirectBodyState2D" /> <argument index="0" name="body" type="RID" /> <description> - Returns the [PhysicsDirectBodyState2D] of the body. + Returns the [PhysicsDirectBodyState2D] of the body. Returns [code]null[/code] if the body is destroyed or removed from the physics space. </description> </method> <method name="body_get_max_contacts_reported" qualifiers="const"> diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml index 0f02cdf92f..b144c2c299 100644 --- a/doc/classes/PhysicsServer3D.xml +++ b/doc/classes/PhysicsServer3D.xml @@ -320,7 +320,7 @@ <return type="PhysicsDirectBodyState3D" /> <argument index="0" name="body" type="RID" /> <description> - Returns the [PhysicsDirectBodyState3D] of the body. + Returns the [PhysicsDirectBodyState3D] of the body. Returns [code]null[/code] if the body is destroyed or removed from the physics space. </description> </method> <method name="body_get_max_contacts_reported" qualifiers="const"> |