minetest-LOTR / Lord-of-the-Test

LOTR-inspired Subgame for Minetest. Rewrite: https://github.com/minetest-LOTR/Third-Age
Other
67 stars 31 forks source link

minetest.create_detached_inventory updates #94

Closed Fixer-007 closed 7 years ago

Fixer-007 commented 7 years ago

There were changes to minetest.create_detached_inventory function, due to bug https://github.com/minetest/minetest/issues/4403, there were fixes merged: https://github.com/minetest/minetest/pull/4812 and https://github.com/minetest/minetest_game/pull/1413.

Basically on player join all other players detached inventories were send to player causing him to have severe 0 0 0 bug for several minutes on some servers. This was fixed, but some mod makers should check their mods for use of this function to send only his player inventory to him if needed.

Also quoting sfan5 about minetest.create_detached_inventory(player:get_player_name():

everything with :get_player_name() definitely need a fix

New function info:

* `minetest.create_detached_inventory(name, callbacks, [player_name])`: returns an `InvRef`
    * callbacks: See "Detached inventory callbacks"
    * player_name: Make detached inventory available to one player exclusively,
      by default they will be sent to every player (even if not used).
      Note that this parameter is mostly just a workaround and will be removed in future releases.
    * Creates a detached inventory. If it already exists, it is cleared.

Your mod has this:

Lord-of-the-Test/mods/lottarmor/armor.lua:481:     local bags_inv = minetest.create_detached_inventory(player:get_player_name().."_bags",{

I hope I described it right. Some mods are already updated. This post is copy pasted. If not sure ask on IRC.

Amaz1 commented 7 years ago

Hopefully this should fix it for LOTT. Thank you!