Skip to content
Snippets Groups Projects
Commit 77873ddb authored by tenplus1's avatar tenplus1 Committed by Milan
Browse files

cherry-pick from github.com/minetest/minetest_game> Creative: Fix '-' glitch in playername

Fix the glitch when players use the '-' character in their username
on a server, causing creative inventory to not pass page 2
parent 5e842465
No related branches found
No related tags found
No related merge requests found
......@@ -194,8 +194,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
creative.set_creative_formspec(player, 0)
else
local formspec = player:get_inventory_formspec()
local start_i = formspec:match("list%[.-" .. player_name .. ";.-;(%d+)%]")
start_i = tonumber(start_i) or 0
local start_i = player_inventory[player_name].start_i or 0
if fields.creative_prev then
start_i = start_i - 3*8
......@@ -212,6 +211,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end
end
player_inventory[player_name].start_i = start_i
creative.set_creative_formspec(player, start_i)
end
end)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment