trees: Reduce local variables (#2637)
authororbea <orbea@riseup.net>
Tue, 7 Apr 2020 17:36:03 +0000 (17:36 +0000)
committerGitHub <noreply@github.com>
Tue, 7 Apr 2020 17:36:03 +0000 (19:36 +0200)
mods/default/trees.lua

index ad3e3f4c77911c6fd267e4087236f92f431972c8..a850644c389fbefe2354703ad1d1e1b8ad1a739f 100644 (file)
@@ -16,9 +16,7 @@ function default.can_grow(pos)
        if not node_under then
                return false
        end
-       local name_under = node_under.name
-       local is_soil = minetest.get_item_group(name_under, "soil")
-       if is_soil == 0 then
+       if minetest.get_item_group(node_under.name, "soil") == 0 then
                return false
        end
        local light_level = minetest.get_node_light(pos)