mirror of
https://github.com/mt-mods/unifieddyes.git
synced 2024-11-22 15:33:52 +01:00
Airbrush: Fix dye selection by not relying on internal behaviour of minetest.serialize (#10)
This commit is contained in:
parent
878377301f
commit
96a939c069
@ -455,14 +455,13 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
local s1 = string.sub(minetest.serialize(fields), 11)
|
local color, _ = next(fields)
|
||||||
local s3 = string.sub(s1,1, string.find(s1, '"')-1)
|
|
||||||
|
|
||||||
local inv = player:get_inventory()
|
local inv = player:get_inventory()
|
||||||
local creative = minetest.is_creative_enabled(player_name)
|
local creative = minetest.is_creative_enabled(player_name)
|
||||||
local dye = "dye:"..s3
|
local dye = "dye:"..color
|
||||||
|
|
||||||
if (showall or unifieddyes.palette_has_color[nodepalette.."_"..s3]) and
|
if (showall or unifieddyes.palette_has_color[nodepalette.."_"..color]) and
|
||||||
(creative or inv:contains_item("main", dye)) then
|
(creative or inv:contains_item("main", dye)) then
|
||||||
unifieddyes.player_selected_dye[player_name] = dye
|
unifieddyes.player_selected_dye[player_name] = dye
|
||||||
unifieddyes.show_airbrush_form(player)
|
unifieddyes.show_airbrush_form(player)
|
||||||
|
Loading…
Reference in New Issue
Block a user