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

Not understanding error code #59

Open
Alatarius opened this issue Jan 12, 2024 · 1 comment
Open

Not understanding error code #59

Alatarius opened this issue Jan 12, 2024 · 1 comment

Comments

@Alatarius
Copy link

Describe the bug
Not sure if it's a bug or not

I often get this error pop up in my chat area when WV is active:

ERROR[Server]: [working_villages] error in job_thread D:\Games\Minetest\bin..\mods\leads/internal.lua:40: attempt to call method 'get_player_control' (a nil value): stack traceback:
D:\Games\Minetest\bin..\mods\leads/internal.lua: in function 'on_place'
...ods\working_villages\working_villagers/async_actions.lua:233: in function 'place'
...s\working_villages\working_villagers/jobs/woodcutter.lua:90: in function <...s\working_villages\working_villagers/jobs/woodcutter.lua:69>

I'm not sure if this is a bug or just a simple glitch. It doesn't stop the game or anything and the NPCs still do their job so I'm not understanding this one.

@lmaddox
Copy link

lmaddox commented Jan 14, 2024

The leads mod is not written with any sort of fake player awareness. The line 40 in question:

if placer and not placer:get_player_control().sneak then

My pull request contains a patch for this, but I'm a n00b (ie this is my first pull request), and it contains unreasonably many bug patches and additional features, having touched nearly every single line in the codebase (not too much of a hyperbole).

In the meantime, you can go into your working_villagers/api.lua and add something like:

function working_villages.villager:get_player_control()
  return self.object:get_player_control()
end

which I copied from feed_buckets, which appears to have great fake_player support (I haven't actually used the mod, but it's code looks good).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants