MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / ProprogateUltimateAttachParent

Function ProprogateUltimateAttachParent

Descent3/attach.cpp:450–469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

448}
449
450static void ProprogateUltimateAttachParent(object *parent, int ultimate_handle) {
451 int i;
452
453 ASSERT(parent);
454 ASSERT(ultimate_handle != OBJECT_HANDLE_NONE);
455
456 poly_model *parent_pm = &Poly_models[parent->rtype.pobj_info.model_num];
457
458 if (!parent->attach_children)
459 return;
460
461 for (i = 0; i < parent_pm->n_attach; i++) {
462 object *child;
463
464 if ((child = ObjGet(parent->attach_children[i])) != NULL) {
465 child->attach_ultimate_handle = ultimate_handle;
466 ProprogateUltimateAttachParent(child, ultimate_handle);
467 }
468 }
469}
470
471// Attaches 2 objects via attach points on each. The f_used_aligned allows for an aligned connection.
472// NOTE: The child always moves to the parent

Callers 2

AttachObjectFunction · 0.85
UnattachFromParentFunction · 0.85

Calls 1

ObjGetFunction · 0.85

Tested by

no test coverage detected