Skip to content

Commit

Permalink
Stairs: Safer slab name check
Browse files Browse the repository at this point in the history
Before, it checked if the node name *contained* "stairs:slab_", which could detect
things like "xxxxxstairs:slab_xxxx". Changed the pattern to "^stairs:slab_".
  • Loading branch information
12Me21 authored and paramat committed Sep 3, 2018
1 parent ef20f9e commit aafe31c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mods/stairs/init.lua
Expand Up @@ -185,7 +185,7 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
local creative_enabled = (creative and creative.is_enabled_for
and creative.is_enabled_for(player_name))

if under and under.name:find("stairs:slab_") then
if under and under.name:find("^stairs:slab_") then
-- place slab using under node orientation
local dir = minetest.dir_to_facedir(vector.subtract(
pointed_thing.above, pointed_thing.under), true)
Expand Down

0 comments on commit aafe31c

Please sign in to comment.