Merge pull request #101011 from aaronfranke/limit-max-contacts-reported

Place a hard limit on the `max_contacts_reported` property in 2D/3D physics
This commit is contained in:
Thaddeus Crews 2025-04-09 18:11:53 -05:00
commit 171187d1aa
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
7 changed files with 9 additions and 1 deletions

View file

@ -175,6 +175,7 @@ public:
}
_FORCE_INLINE_ void set_max_contacts_reported(int p_size) {
ERR_FAIL_INDEX(p_size, MAX_CONTACTS_REPORTED_3D_MAX);
contacts.resize(p_size);
contact_count = 0;
if (mode == PhysicsServer3D::BODY_MODE_KINEMATIC && p_size) {