Skip to content

Commit

Permalink
fix: Account for AbstractExtendedVariantTrigger<T> triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
psyGamer committed Jan 3, 2025
1 parent 8ac391d commit 752f054
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,22 @@ private static void Initialize() {
"ExtendedVariants.Entities.Legacy.ExtendedVariantFadeTrigger",
"ExtendedVariants.Entities.ForMappers.FloatExtendedVariantFadeTrigger"
).ForEach(type => {
triggerChecks.Add((entity, entityType) => entityType == type
&& entity.GetFieldValue<object>("variantChange") is { } variantChange
&& unimportantVariants.Contains(variantChange));
triggerChecks.Add((entity, entityType) =>
entityType == type
&& entity.GetFieldValue<object>("variantChange") is { } variantChange
&& unimportantVariants.Contains(variantChange)
);
});

if (ModUtils.GetType("ExtendedVariantMode", "ExtendedVariants.Entities.ForMappers.AbstractExtendedVariantTrigger`1") is { } abstractExtendedVariantTriggerType) {
triggerChecks.Add((entity, entityType) =>
entityType.BaseType is { } type
&& type.IsGenericType
&& type.GetGenericTypeDefinition() == abstractExtendedVariantTriggerType
&& entity.GetFieldValue<object>("variantChange") is { } variantChange
&& unimportantVariants.Contains(variantChange)
);
}
}

// Gather camera triggers to recolor them
Expand Down

0 comments on commit 752f054

Please sign in to comment.