stujones11 / minetest-3d_armor

Visible player armor & wielded items for minetest
Other
56 stars 98 forks source link

bad argument #1 to 'gsub' #93

Closed verymilan closed 7 years ago

verymilan commented 7 years ago

Hi there, today i've updated alot of mods including 3d_armor on a testserver. Firstly i got an bad argument #1 to 'gsub'from character_creator in relation to 3d_armor. After removing it, it stays but comes directly from 3d_armor.

I am not sure how ti deal with this and would be happy getting some help / a fix if needed.

Kind regards

  ServerError: Runtime error from mod '3d_armor' in callback environment_Step(): ...in/../games/minetest_game/mods/3d_armor/3d_armor/api.lua:248: bad argument #1 to 'gsub' (string expected, got nil)
  stack traceback:
        [C]: in function 'gsub'
        ...in/../games/minetest_game/mods/3d_armor/3d_armor/api.lua:248: in function 'get_player_skin'
        ...in/../games/minetest_game/mods/3d_armor/3d_armor/api.lua:258: in function 'get_preview'
        ...in/../games/minetest_game/mods/3d_armor/3d_armor/api.lua:147: in function 'set_player_armor'
        ...n/../games/minetest_game/mods/3d_armor/3d_armor/init.lua:292: in function 'func'
        ../builtin/game/misc.lua:34: in function <../builtin/game/misc.lua:11>
        ../builtin/game/register.lua:412: in function <../builtin/game/register.lua:392>
stujones11 commented 7 years ago

Thank you for the report, I will look into that asap. I am currently in the process of merging features from my stale dev branch and generally re-factoring the code so you might be best sticking with the latest release version for now. https://github.com/stujones11/minetest-3d_armor/releases/tag/version-0.4.8

stujones11 commented 7 years ago

Are you using the wardrobe mod by any chance and if so, what version?

verymilan commented 7 years ago

Oooooh that was the difference i didn't remember for a moment, thanks! I actually have this mod - a fork, it is based on commit c48b0118 (oh boy is this old)

I had this temporally moved away because i am unable to enable mod security with multible mods:

So later i decided to just disable modsecurity and there was the problem. Right now the server is stable without the mod woohoo. :)

And just for me there is nothing to hurry, i think the most players don't use the wardrobe anyway when the (yet) testserver is getting launched. 🐈 (there is also charactor_creator, serverside customskins...)

Thanks again, happy re-factoring! :D And thanks for the mod in general for sure!

verymilan commented 7 years ago

🎉