Skip to content

Commit 838ad60

Browse files
Pedro Gimenosfan5
authored andcommitted
Fix dry_grass_N on dirt producing dirt_with_grass
`dry_grass_N` has groups `grass` and `dry_grass`, so if the check for `grass` is done first, having dry_grass on it makes it turn into `dirt_with_grass` instead of `dirt_with_dry_grass`. Changing the order fixes this.
1 parent c6fabe4 commit 838ad60

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mods/default/functions.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,10 +645,11 @@ minetest.register_abm({
645645
-- Snow check is cheapest, so comes first
646646
if name == "default:snow" then
647647
minetest.set_node(pos, {name = "default:dirt_with_snow"})
648-
elseif minetest.get_item_group(name, "grass") ~= 0 then
649-
minetest.set_node(pos, {name = "default:dirt_with_grass"})
648+
-- The group grass is also present in dry grass, so check dry grass first
650649
elseif minetest.get_item_group(name, "dry_grass") ~= 0 then
651650
minetest.set_node(pos, {name = "default:dirt_with_dry_grass"})
651+
elseif minetest.get_item_group(name, "grass") ~= 0 then
652+
minetest.set_node(pos, {name = "default:dirt_with_grass"})
652653
end
653654
end
654655
})

0 commit comments

Comments
 (0)