Place a hard limit on the max_contacts_reported property

This commit is contained in:
Aaron Franke
2025-01-01 17:20:07 -08:00
parent 7598b08ec2
commit a5de242a2f
7 changed files with 9 additions and 1 deletions

View File

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