Skip to content

Constraintcore bone functions select wrong bones #3471

@Darmagon3

Description

@Darmagon3

Describe the bug

Any attempt to weld, nocollide, rope, slider, or hydraulic a ragdoll bone will always target bone 0
All constraintcore functions involving bones use local ent, index = isValidBone(bone) to acquire the bone index
isValidBone(b) always returns a second value of 0 or nil, so the bone index is always 0 or nil.

How to reproduce the bug

Create an E2 that targets and constrains a bone of a ragdoll other than bone 0.
If this E2 attempts to constrain bone 0, the bug has occurred.

An example E2 is provided:

@name bugreport/constraintcore_wrong_bone
@strict

Entity = entity():isConstrainedTo() #put this E2 on a ragdoll
Bone1 = Entity:bone(1)
Bone2 = Entity:bone(2)
Bone1:weld(Bone2) #Weld bone 1 to bone 2
#Constraint creation failed!
#This actually welds bone 0 to bone 0, constraint creation will always fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions