back compatibility with older animations

This commit is contained in:
c0ffeeeeeeee 2021-02-19 12:52:15 -08:00
parent 440092ff57
commit 670e0ffc32
3 changed files with 2 additions and 2 deletions

View File

@ -108,7 +108,7 @@ namespace Rimworld_Animations {
Log.Message("Selecting animation for interaction type " + sexProps.DictionaryKey.defName + "...");
return optionsWithInteractionType.RandomElement();
}
List<AnimationDef> optionsWithSexType = options.ToList().FindAll(x => x.sexTypes.Contains(sexType));
List<AnimationDef> optionsWithSexType = options.ToList().FindAll(x => x.sexTypes != null && x.sexTypes.Contains(sexType));
if (optionsWithSexType.Any()) {
if (AnimationSettings.debugMode)
Log.Message("Selecting animation for rjwSexType " + sexType.ToStringSafe() + "...");

View File

@ -13,7 +13,7 @@ namespace Rimworld_Animations {
public List<Actor> actors;
public int animationTimeTicks = 0; //do not set manually
public bool sounds = false;
public List<rjw.xxx.rjwSextype> sexTypes;
public List<rjw.xxx.rjwSextype> sexTypes = null;
public List<InteractionDef> interactionDefTypes = null;
public override void PostLoad() {