Skip to content

Metadata ctor is incorrect #2

Closed as not planned
Closed as not planned

Description

@AzuStar

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."

Activity

  1. AzuStar commented on Jul 19, 2022

    @AzuStar
    Author

    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")

  2. Drake53 commented on Jul 20, 2022

    @Drake53
    Owner

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions