Skip to content

TypeHandler public api and Prefabs fix#137

Open
johnklipi wants to merge 2 commits intomainfrom
typehandlersapi
Open

TypeHandler public api and Prefabs fix#137
johnklipi wants to merge 2 commits intomainfrom
typehandlersapi

Conversation

@johnklipi
Copy link
Contributor

No description provided.

@johnklipi johnklipi self-assigned this Feb 27, 2026
@johnklipi johnklipi changed the title TypeHandler public api TypeHandler public api and Prefabs fix Feb 27, 2026

typeHandlers[type].Add(handler);

Plugin.logger.LogWarning($"Added TypeHandler for type: {type.ToString()}.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why warning?

[HarmonyPatch(typeof(PrefabManager), nameof(PrefabManager.GetPrefab),
typeof(UnitData.Type), typeof(TribeType), typeof(SkinType)
)]
private static void PrefabManager_GetPrefab(ref Unit __result, UnitData.Type type, TribeType tribe, SkinType skin)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removing old fallback chain logic?

[HarmonyPatch(typeof(PrefabManager), nameof(PrefabManager.GetPrefab), typeof(UnitData.Type), typeof(TribeType), typeof(SkinType))]
public static bool GetPrefab(ref Unit __result, UnitData.Type type, TribeType tribe, SkinType skin)
{
if (SeasonManager.IsChristmas())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SeasonManager.IsChristmas() check is needed no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants