diff options
author | Vanessa Dannenberg <vanessa.e.dannenberg@gmail.com> | 2018-10-19 16:00:05 -0400 |
---|---|---|
committer | Vanessa Dannenberg <vanessa.e.dannenberg@gmail.com> | 2018-10-19 16:00:05 -0400 |
commit | 334de564fd3b23c7e6c5e313fca9edef3daa1d53 (patch) | |
tree | 4cd4c4fb77c71165736a21575016a47e4a4d8313 | |
parent | 545968517bd47d96cf97fef57e5633b247cb2fe0 (diff) | |
download | unifieddyes-334de564fd3b23c7e6c5e313fca9edef3daa1d53.tar unifieddyes-334de564fd3b23c7e6c5e313fca9edef3daa1d53.tar.gz unifieddyes-334de564fd3b23c7e6c5e313fca9edef3daa1d53.tar.bz2 unifieddyes-334de564fd3b23c7e6c5e313fca9edef3daa1d53.tar.xz unifieddyes-334de564fd3b23c7e6c5e313fca9edef3daa1d53.zip |
fix crash
when trying to airbrush unknown nodes or nodes without palettes.
-rw-r--r-- | init.lua | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -667,7 +667,10 @@ function unifieddyes.on_airbrush(itemstack, player, pointed_thing) local palette = nil local fdir = 0 - if def.palette == "unifieddyes_palette_extended.png" then + if not def or not def.palette then + minetest.chat_send_player(player_name, "*** That node can't be colored -- it's either undefined or has no palette.") + return + elseif def.palette == "unifieddyes_palette_extended.png" then palette = "extended" elseif def.palette == "unifieddyes_palette_colorwallmounted.png" then palette = "wallmounted" |