summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-02-26 10:55:49 -0500
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-02-26 10:55:49 -0500
commit0cd0758c089ad1e7720ab8ea3951d4d2b3d12e31 (patch)
tree7a9dd6f60fa1ca7a8b83766e0f5176dee62d4682
parent46a55946ef2b940109f84a9c111ec340f9409ccd (diff)
downloadunifieddyes-0cd0758c089ad1e7720ab8ea3951d4d2b3d12e31.tar
unifieddyes-0cd0758c089ad1e7720ab8ea3951d4d2b3d12e31.tar.gz
unifieddyes-0cd0758c089ad1e7720ab8ea3951d4d2b3d12e31.tar.bz2
unifieddyes-0cd0758c089ad1e7720ab8ea3951d4d2b3d12e31.tar.xz
unifieddyes-0cd0758c089ad1e7720ab8ea3951d4d2b3d12e31.zip
only use the node def's palette entry to check palette type
(don't assume it has to be paramtype2="color", otherwise that screws up uncolored nodes that need this check for on_use)
-rw-r--r--init.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/init.lua b/init.lua
index 240e5d5..a70eb21 100644
--- a/init.lua
+++ b/init.lua
@@ -522,18 +522,18 @@ function unifieddyes.on_use(itemstack, player, pointed_thing)
local newnode = nodedef.ud_replacement_node
local palette_type
- if nodedef.paramtype2 == "color" then
- if nodedef.palette == "unifieddyes_palette_extended.png" then
- palette_type = "extended"
- else
- palette_type = false
- end
+ if nodedef.palette == "unifieddyes_palette_extended.png" then
+ palette_type = "extended"
+ elseif nodedef.palette == "unifieddyes_palette.png" then
+ palette_type = false
elseif nodedef.paramtype2 == "colorfacedir" then
palette_type = true
elseif nodedef.paramtype2 == "colorwallmounted" then
palette_type = "wallmounted"
end
+ print(palette_type)
+
if minetest.is_protected(pos, playername) and not minetest.check_player_privs(playername, {protection_bypass=true}) then
minetest.record_protection_violation(pos, playername)
return