ElCeejo / draconis

Adds Dragons and related resources and equipment to Minetest Game
MIT License
18 stars 23 forks source link

crash on spawn dragon MineClonia/MineClone2 #34

Open nonfreegithub opened 1 year ago

nonfreegithub commented 1 year ago

Minetest version:

5.7.0

MineClone version:

Cloned from git master branch commit b4c693bb205777b39446fe631ac02823656cc26d

Creatura version:

main branch commit 97375e088887e1fce8e30c34a1c2ed56f1cbce51

Draconis version:

main branch commit 744cab73d95631ad3ca36981ef4100bcb408cf81

AsyncErr: Lua: Runtime error from mod '??' in callback luaentity_Step(): ...in/../games/MineClone2/mods/PLAYER/mcl_gamemode/init.lua:53: bad argument #1 to 'get_player_by_name' (string expected, got userdata)
stack traceback:
    [C]: in function 'get_player_by_name'
    ...in/../games/MineClone2/mods/PLAYER/mcl_gamemode/init.lua:53: in function 'old_is_creative_enabled'
    .../bin/../games/MineClone2/mods/HUD/mcl_inventory/init.lua:134: in function 'is_creative_enabled'
    ...Minetest/minetest/bin/../mods/draconis/api/behaviors.lua:142: in function 'find_target'
    ...Minetest/minetest/bin/../mods/draconis/api/behaviors.lua:1173: in function 'get_score'
    ...art1/Minetest/minetest/bin/../mods/creatura/mob_meta.lua:1100: in function '_execute_utilities'
    ...art1/Minetest/minetest/bin/../mods/creatura/mob_meta.lua:938: in function 'on_step_old'
    ...mes/MineClone2/mods/ENVIRONMENT/mcl_void_damage/init.lua:24: in function <...mes/MineClone2/mods/ENVIRONMENT/mcl_void_damage/init.lua:23>
corarona commented 1 year ago

just encountered this too trying draconis in mineclonia it's the same bug as https://github.com/ElCeejo/creatura/issues/17 - you need to call is_creative_enabled with the player's name not the object:

$ grep -nr is_creative_enabled draconis 
draconis/craftitems.lua:111:    if not minetest.is_creative_enabled(clicker) then
draconis/api/behaviors.lua:142:     local is_creative = target:is_player() and minetest.is_creative_enabled(target)
draconis/api/api.lua:1337:          if not minetest.is_creative_enabled(player) then
draconis/api/api.lua:1517:          if not minetest.is_creative_enabled(player) then