1
0
mirror of https://github.com/minetest/minetest_game.git synced 2025-04-29 13:30:20 +02:00

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.
This commit is contained in:
Pedro Gimeno 2025-04-19 18:40:59 +02:00 committed by sfan5
parent c6fabe4734
commit 838ad60ad0

View File

@ -645,10 +645,11 @@ minetest.register_abm({
-- Snow check is cheapest, so comes first -- Snow check is cheapest, so comes first
if name == "default:snow" then if name == "default:snow" then
minetest.set_node(pos, {name = "default:dirt_with_snow"}) minetest.set_node(pos, {name = "default:dirt_with_snow"})
elseif minetest.get_item_group(name, "grass") ~= 0 then -- The group grass is also present in dry grass, so check dry grass first
minetest.set_node(pos, {name = "default:dirt_with_grass"})
elseif minetest.get_item_group(name, "dry_grass") ~= 0 then elseif minetest.get_item_group(name, "dry_grass") ~= 0 then
minetest.set_node(pos, {name = "default:dirt_with_dry_grass"}) minetest.set_node(pos, {name = "default:dirt_with_dry_grass"})
elseif minetest.get_item_group(name, "grass") ~= 0 then
minetest.set_node(pos, {name = "default:dirt_with_grass"})
end end
end end
}) })