Page 1 of 1

Undefined argument in util.loadfilemods

Posted: Sun Feb 05, 2012 1:08 am
by yufra
I am poking around at the addon code and believe that I have a found an undefined `bname` variable inside of `util.loadfilemods`:

Code: Select all

1002 function util.loadfilemods(file, env)
...
1017                                         local ok, err = pcall(base, bname)
The `base` variable is the function returned by `loadfile`, so I don't think that it accepts any arguments anyway. If I am not understanding can you explain what is going on? Cheers!

EDIT: I got there eventually. :D DG is doing some fancy magic with the `te4_loader` function and `package.loaders`, so nothing to see here. Unless you want to understand how the addons are actually implemented that is.