Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

necrolua.get returns wrong type (c_Familiar) #5

@pancelor

Description

@pancelor

Here's the full text of my mod:

necrolua.hook("c_Player::p_UseBomb", function(func, self)
  print "c_Player::p_UseBomb"

  local cls = necrolua.get("c_Enemy")
  local obj = cls:m_GetRandomEnemy()
end)

I load the game and press my bomb hotkey (in the lobby, not that it should matter), and necrolua.exe crashes:

c_Player::p_UseBomb
[←[33mNecroLuaAPI.dll←[0m][←[32mLua←[0m] nl_luainit.lua:424: nl_get :: cast("c_Familiar*", 11)
mods\0luatest\lua\init.lua:5: 'struct c_Familiar' has no member named 'm_GetRandomEnemy'
stack traceback:
        mods\0luatest\lua\init.lua:5: in function <mods\0luatest\lua\init.lua:1>
        [C]: in function 'xpcall'
        nl_luainit.lua:451: in function <nl_luainit.lua:450>
[←[33mNecroLuaAPI.dll←[0m] nl_payload.c:150: Mod API finalized.
[NecroLua.exe] nl_launcher.c: 58: Done with exit code 0x00000001

Note in particular: 'struct c_Familiar' has no member named 'm_GetRandomEnemy'. This is strange; did necrolua.get("c_Enemy") return a c_Familiar instead of a c_Enemy?

Changing necrolua.get("c_Enemy") to necrolua.get("c_Player") results in the exact same error (still c_Familiar)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions