Unattaches all children from a parent object
| 685 | |
| 686 | // Unattaches all children from a parent object |
| 687 | bool UnattachChildren(object *parent) { |
| 688 | poly_model *parent_pm = &Poly_models[parent->rtype.pobj_info.model_num]; |
| 689 | int i; |
| 690 | |
| 691 | if (!parent->attach_children) |
| 692 | return false; |
| 693 | |
| 694 | for (i = 0; i < parent_pm->n_attach; i++) { |
| 695 | object *child; |
| 696 | |
| 697 | if ((child = ObjGet(parent->attach_children[i])) != NULL) { |
| 698 | UnattachFromParent(child); |
| 699 | } |
| 700 | } |
| 701 | |
| 702 | return true; |
| 703 | } |
no test coverage detected