better error handling for checkandplaysounds
This commit is contained in:
parent
3f7a7bfdc3
commit
66f84a00f3
Binary file not shown.
|
@ -217,19 +217,24 @@ namespace Rimworld_Animations {
|
|||
|
||||
}
|
||||
|
||||
//do the same for all the child nodes
|
||||
foreach (PawnRenderNode node in rootNode.children)
|
||||
|
||||
if (rootNode?.children != null)
|
||||
{
|
||||
if (node?.AnimationWorker is AnimationWorker_KeyframesExtended childrenAnimWorker)
|
||||
foreach (PawnRenderNode node in rootNode?.children)
|
||||
{
|
||||
SoundDef sound = childrenAnimWorker.soundAtTick(node.tree.AnimationTick);
|
||||
if (sound != null)
|
||||
if (node?.AnimationWorker is AnimationWorker_KeyframesExtended childrenAnimWorker)
|
||||
{
|
||||
sound.PlayOneShot(new TargetInfo(pawn.Position, pawn.Map));
|
||||
SoundDef sound = childrenAnimWorker.soundAtTick(node.tree.AnimationTick);
|
||||
if (sound != null)
|
||||
{
|
||||
sound.PlayOneShot(new TargetInfo(pawn.Position, pawn.Map));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//do the same for all the child nodes
|
||||
|
||||
}
|
||||
|
||||
public bool AnimationMakesUseOfProp(AnimationPropDef animationProp)
|
||||
|
|
Loading…
Reference in New Issue