It seems that some functions that are available from the global scope are incorrectly transpiled to Lua.
For example:
const map = GetMapById(1);
print(map.GetName());
transpiles to
local map = GetMapById(nil, 1)
print(
map:GetName()
)
notice the nil before the 1, which causes an error: bad argument #1 to 'GetMapById' (number expected, got nil)
Same behavior with
const query = CharDBQuery("...");
which transpiles to
local query = CharDBQuery(nil, "...")
and therefore gives the error bad argument #1 to 'CharDBQuery' (string expected, got nil)
I'm using the following versions:
@azerothcore/eluna-ts-lib: ^1.0.13
typescript: 4.2.4
typescript-to-lua: ^0.39.3
- Node v14.16.0