mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2024-12-29 18:55:06 +08:00
fix: NPEs resulting from bones being deleted under armature lock (#448)
Fixes: #447
This commit is contained in:
parent
37309125ea
commit
11b10a82d5
@ -169,6 +169,12 @@ namespace nadena.dev.modular_avatar.core.armature_lock
|
||||
// Check parents haven't changed
|
||||
for (int i = 0; i < _baseBones.Length; i++)
|
||||
{
|
||||
if (_baseBones[i] == null || _mergeBones[i] == null || _baseParentBones[i] == null ||
|
||||
_mergeParentBones[i] == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_baseBones[i].parent != _baseParentBones[i] || _mergeBones[i].parent != _mergeParentBones[i])
|
||||
{
|
||||
return false;
|
||||
|
@ -174,6 +174,8 @@ namespace nadena.dev.modular_avatar.core.armature_lock
|
||||
handle = default;
|
||||
if (_disposed) return false;
|
||||
|
||||
LastOp.Complete();
|
||||
|
||||
_fault.Value = 0;
|
||||
_wroteAny.Value = 0;
|
||||
|
||||
@ -199,6 +201,12 @@ namespace nadena.dev.modular_avatar.core.armature_lock
|
||||
// Validate parents while that job is running
|
||||
for (int i = 0; i < _baseBones.Length; i++)
|
||||
{
|
||||
if (_baseBones[i] == null || _mergeBones[i] == null || _baseParentBones[i] == null ||
|
||||
_mergeParentBones[i] == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_baseBones[i].parent != _baseParentBones[i] || _mergeBones[i].parent != _mergeParentBones[i])
|
||||
{
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user