mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 12:12:28 +00:00
Merge pull request #68082 from Klowner/softbody3d-reoptmizelinkorder-crash-fix
Avoid GodotSoftBody3D.reoptimize_link_order() crash if <2 nodes available.
This commit is contained in:
commit
5dfde1e7bd
@ -722,7 +722,14 @@ void GodotSoftBody3D::reoptimize_link_order() {
|
||||
const int reop_not_dependent = -1;
|
||||
const int reop_node_complete = -2;
|
||||
|
||||
uint32_t i, link_count = links.size(), node_count = nodes.size();
|
||||
uint32_t link_count = links.size();
|
||||
uint32_t node_count = nodes.size();
|
||||
|
||||
if (link_count < 1 || node_count < 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t i;
|
||||
Link *lr;
|
||||
int ar, br;
|
||||
Node *node0 = &(nodes[0]);
|
||||
|
Loading…
Reference in New Issue
Block a user