ultimate-research / ssbh_lib

Reading and writing SSBH file formats in Rust
MIT License
8 stars 3 forks source link

fix potential infinite loop in SkelData::calculate_world_transform #86

Closed ScanMountGoat closed 3 years ago

ScanMountGoat commented 3 years ago

The current implementation loops infinitely on bone chains that form a cycle, including self referential bones. There isn't a reasonable value to return in either case, so it makes sense to just return a meaningful error.

enum BoneTransformError {
    CycleDetected(start_index, end_index),
    SelfReferentialBone(index)
}