Mutual anchor condition fixed

This commit is contained in:
Tracy Rust 2024-04-02 12:59:19 -04:00
parent 1aedcd5ac4
commit 42707b3589
1 changed files with 12 additions and 3 deletions

View File

@ -306,10 +306,19 @@ function pickTopPropertyRecord(property) {
if(!(anchoredMachineId in candidates))
continue;
const candidateMachineIndex = candidates[anchoredMachineId].machineIndex;
const ourAnchor = prop.anchors[anchoredMachineId];
const candidateRecord = candidates[anchoredMachineId];
if(candidateMachineIndex <= ourAnchor) {
const candidateMachineIndex = candidateRecord.machineIndex;
const ourAnchorIndex = prop.anchors[anchoredMachineId];
if(candidateMachineIndex === ourAnchorIndex && prop.machineId in candidateRecord.anchors) {
if(prop.machineIndex === candidateRecord.anchors[prop.machineId]) {
//mutual anchor condition. Shouldn't be possible and yet here we are!
continue;
}
}
if(candidateMachineIndex <= ourAnchorIndex) {
delete candidates[anchoredMachineId];
}
}