Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata ctor is incorrect #2

Closed
AzuStar opened this issue Jul 19, 2022 · 2 comments
Closed

Metadata ctor is incorrect #2

AzuStar opened this issue Jul 19, 2022 · 2 comments

Comments

@AzuStar
Copy link

AzuStar commented Jul 19, 2022

I have a unit constructor that looks like this:

 protected NoxUnit(unit u, Stats initialStats = null) { ... }

Units are instantiated through Activator.CreateInstance

(NoxUnit)Activator.CreateInstance(CustomTypes[GetUnitTypeId(u)], u);

Lua exportMetadata exports this .ctor metadata

 methods = {
            { ".ctor", 0x206, nil, out.War3Api.Common.unit, out.NoxRaven.UnitAgents.Stats },

When launching the game, create instance returns nothing because it cannot find proper ctor.
The error I get is

Site: "System.MissingMethodException",
Message: "Specified method could not be found."
@AzuStar
Copy link
Author

AzuStar commented Jul 19, 2022

This issue might have to be escalated to original LuaCsharp beucase I found more methods with exported metadata get broken, usually ones with predefined default value like DoStuff(string test = "default value")

@Drake53
Copy link
Owner

Drake53 commented Jul 20, 2022

I can't transfer this issue upstream so you'll have to create a new issue in the original CSharpLua repository.

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

No branches or pull requests

2 participants