Fix Descriptors not being populated correctly

This commit is contained in:
Evil Factory
2026-02-20 19:32:15 -03:00
parent 124b1e545d
commit ddd9dac2fb
2 changed files with 5 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ AddTableToGlobal(dofile(path .. "/Lua/CompatibilityLib.lua"))
dofile(path .. "/Lua/DefaultHook.lua")
Descriptors = LuaSetup.LuaUserData
Descriptors = LuaUserData
dofile(path .. "/Lua/DefaultLib/Utils/Math.lua")
dofile(path .. "/Lua/DefaultLib/Utils/String.lua")

View File

@@ -87,7 +87,10 @@ public class LuaUserDataService : ILuaUserDataService
throw new ScriptRuntimeException($"tried to register a type that doesn't exist: {typeName}.");
}
return UserData.RegisterType(type);
var descriptor = UserData.RegisterType(type);
descriptors.TryAdd(typeName, descriptor);
return descriptor;
}
public void RegisterExtensionType(string typeName)