Yes. Calling NDB_NewtonDestroyRagdoll destroys all ragdoll bones, even causing a crash if there are no bones to delete. However, it does not reset the bone counter, which leads to those problems. I've reworked my editor to use the NDB_NewtonBodySetCollision command instead of destroying bones, but it would still be easier to destroy the ragdoll itself.
As a test, I put this block in my loop:
if keystate(45) rem x key
if NDB_RagdollExist(CompObj(0))
NDB_NewtonDestroyRagDoll CompObj(0)
CompObj(0) = NDB_NewtonCreateRagdoll()
NDB_NewtonRagdollBegin CompObj(0)
NDB_BuildMatrix 0, 0, 0, 0, 0, 0
NDB_SetVector 1, 10, 10, 10
tempA = NDB_NewtonRagdollAddBone(CompObj(0), 0, CompData(1), 10.0)
report error str$(CompObj(0)) + ", " + str$(tempA)
endif
endif
I created a ragdoll with 4 bones, then pressed x. That raised the error I set here, and gave me "1, 5". Destroying the ragdoll removed the bones' bodies, but does not reset the bone counter.