1
0
mirror of https://github.com/mt-mods/unifieddyes.git synced 2025-06-30 15:20:44 +02:00

Compare commits

...

4 Commits

Author SHA1 Message Date
c91c68e0f5 Merge branch '6-move_item_crash' into 'master'
fix(bug):fix for a rare crash due to on_dig callback by non-player.

Closes #6

See merge request VanessaE/unifieddyes!6
2020-07-09 16:19:35 +00:00
09f95729c5 fix(bug):fix for a rare crash due to on_dig callback by non-player. 2020-07-09 12:05:10 -04:00
71d7e3c954 add minimum minetest version key for contentdb 2020-06-03 13:00:38 -04:00
17e87a8162 add sanity checks for when what should be a player/digger is nil 2020-05-10 18:41:17 -04:00
3 changed files with 5 additions and 3 deletions

1
.gitignore vendored
View File

@ -1 +0,0 @@
*~

View File

@ -161,7 +161,8 @@ minetest.register_on_placenode(
if not def
or not def.palette
or def.after_place_node then
or def.after_place_node
or not placer then
return false
end
@ -192,6 +193,7 @@ minetest.register_on_placenode(
-- The complementary function: strip-off the color if the node being dug is still white/neutral
local function move_item(item, pos, inv, digger)
if not (digger and digger:is_player()) then return end
local creative = creative_mode or minetest.check_player_privs(digger, "creative")
if inv:room_for_item("main", item)
and (not creative or not inv:contains_item("main", item, true)) then
@ -203,7 +205,7 @@ local function move_item(item, pos, inv, digger)
end
function unifieddyes.on_dig(pos, node, digger)
if not digger then return end
local playername = digger:get_player_name()
if minetest.is_protected(pos, playername) then
minetest.record_protection_violation(pos, playername)

View File

@ -1,3 +1,4 @@
name = unifieddyes
description = Unified Dyes expands the standard dye set from 15 to 90 colors.
depends = default, dye, basic_materials
min_minetest_version = 5.2.0