missing compbodyanimator check

This commit is contained in:
c0ffeeeeeeee 2020-10-15 16:55:53 -07:00
parent 16d825975b
commit 4a7faa53b6
2 changed files with 8 additions and 0 deletions

View File

@ -74,6 +74,14 @@ namespace Rimworld_Animations {
pawnsToAnimate = pawnsToAnimate.Append(pawn).ToList();
}
for(int i = 0; i < pawnsToAnimate.Count; i++) {
if(pawnsToAnimate[i].TryGetComp<CompBodyAnimator>() == null) {
Log.Error("Error: " + pawnsToAnimate[i].Name + " of race " + pawnsToAnimate[i].def.defName + " does not have CompBodyAnimator attached!");
break;
}
}
AnimationDef anim = AnimationUtility.tryFindAnimation(ref pawnsToAnimate, sexType, sexProps);
if (anim != null) {