Skip to content

Commit 8e49012

Browse files
committed
Now u can replace prefabs of original units
1 parent b23d2f4 commit 8e49012

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/Loader.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,12 @@ internal record TypeMapping(Type type, bool shouldCreateCache = true);
109109

110110
[typeof(UnitData.Type)] = new((token, duringEnumCacheCreation) =>
111111
{
112-
if (duringEnumCacheCreation)
112+
if (!duringEnumCacheCreation)
113113
{
114114
if (token["prefab"] != null)
115115
{
116-
Registry.prefabNames.Add((int)(UnitData.Type)Registry.autoidx, CultureInfo.CurrentCulture.TextInfo.ToTitleCase(token["prefab"]!.ToString()));
116+
Registry.prefabNames.Add((int)(UnitData.Type)(int)token["idx"], CultureInfo.CurrentCulture.TextInfo.ToTitleCase(token["prefab"]!.ToString()));
117117
}
118-
}
119-
else
120-
{
121118
if (token["embarksTo"] != null)
122119
{
123120
string unitId = Util.GetJTokenName(token);

0 commit comments

Comments
 (0)