[painting] fix brush not painting

dark_grey and dark_green brushes weren't painting before, they do now! thanks to juli for his help!
This commit is contained in:
Elkien3 2017-09-18 10:56:28 -05:00
parent 7c0f44d4e3
commit f6bc6053cc

View File

@ -234,8 +234,9 @@ minetest.register_entity("painting:paintent", {
on_punch = function(self, puncher)
--check for brush.
local name = string.match(puncher:get_wielded_item():get_name(), "_([^_]*)")
local name = string.sub(puncher:get_wielded_item():get_name(), #"painting:brush_"+1)
if not colors[name] then -- Not one of the brushes; can't paint.
minetest.chat_send_all(name)
return
end