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

minetest.is_creative_enabled gets erroneously called with player object instead of name, #17

Closed
corarona opened this issue Sep 29, 2022 · 2 comments

Comments

@corarona
Copy link

corarona commented Sep 29, 2022

tl;dr https://github.com/ElCeejo/creatura/blob/main/api.lua#L448 needs to call it with the name otherwise it breaks any implementation that does something with the argument (like mcl2)

now i would not actually expect creatura to work with mcl2 but this one is your fault :P

https://github.com/minetest/minetest/blob/master/doc/lua_api.txt#L6417

AsyncErr: Lua: Runtime error from mod '??' in callback luaentity_Punch(): ...inetest/games/mineclone2/mods/HUD/mcl_inventory/init.lua:200: bad argument #1 to 'get_player_by_name' (string expected, got userdata)
stack traceback:
    [C]: in function 'get_player_by_name'
    ...inetest/games/mineclone2/mods/HUD/mcl_inventory/init.lua:200: in function 'is_creative_enabled'
    /home/.../.minetest/mods/creatura/api.lua:461: in function 'basic_punch_func'
    /home/.../.minetest/mods/animalia/mobs/chicken.lua:198: in function </home/.../.minetest/mods/animalia/mobs/chicken.lua:197>

originally reported by Faerraven on mcl2 discord

@corarona
Copy link
Author

kind of ironic that it fails because we're trying to get the object with get_player_by_name lol

@ElCeejo
Copy link
Owner

ElCeejo commented Jul 18, 2023

Fixed as of latest commit.

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

No branches or pull requests

2 participants