i3 icon indicating copy to clipboard operation
i3 copied to clipboard

Colored nametags cause invalid inventory location for armor

Open OgelGames opened this issue 1 year ago • 0 comments

Originally reported by @ademant in https://github.com/mt-mods/xp_redo_ranks_ores/issues/4, if a player's nametag is colored, trying to equip armor results in this error:

2023-05-23 15:00:42: WARNING[Main]: GUIInventoryList::draw(): The inventory location "detached:@#ff0000)singleplayer@#ffffff)_armor" doesn't exist

This has been caused by https://github.com/minetest-mods/i3/commit/080579b2a4cd7f674e946430ca11ade2fe1ac4ef, which changed the code to use the player's nametag to create the inventory list (in the formspec), instead of the player's actual name.

Possible solution: use the name that is returned by armor:get_valid_player() here, instead of discarding it: https://github.com/minetest-mods/i3/blob/080579b2a4cd7f674e946430ca11ade2fe1ac4ef/src/gui.lua#L485-L488

OgelGames avatar May 23 '23 14:05 OgelGames