
function inner_placer(x, y, placer)
    x = math.floor(x)
    y = math.floor(y)
    if level.get_tile(x, y).has_property('building_edge') or not placer:owns_tile(x, y)  then
        placer:fail("Must be placed within a building")
        return
    end

    placer:set_tile(x, y, "foundation")
    placer:selection_bound(x, 0.0, y, 1.0, 0.05, 1.0)

	for _, dir in ipairs(direction.ALL) do
        local wall = level.get_wall(x, y, dir)
		if wall == "door" then
            placer:fail("Blocked by door")
            return
        end
		if wall == "window" then
            placer:fail("Blocked by window")
            return
        end
    end

    if not placer:contains_bound(x, y, 1, 1) then
        placer:fail("Must be placed within a building")
        return
    end
    return 0
end