Skip to content

Commit 3976dc6

Browse files
tenplus1paramat
authored andcommittedMay 7, 2016
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
1 parent 8ea031e commit 3976dc6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎mods/creative/init.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
194194
creative.set_creative_formspec(player, 0)
195195
else
196196
local formspec = player:get_inventory_formspec()
197-
local start_i = formspec:match("list%[.-" .. player_name .. ";.-;(%d+)%]")
198-
start_i = tonumber(start_i) or 0
197+
local start_i = player_inventory[player_name].start_i or 0
199198

200199
if fields.creative_prev then
201200
start_i = start_i - 3*8
@@ -212,6 +211,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
212211
end
213212
end
214213

214+
player_inventory[player_name].start_i = start_i
215215
creative.set_creative_formspec(player, start_i)
216216
end
217217
end)

0 commit comments

Comments
 (0)
Please sign in to comment.