When you set the collision mask of a building to floor-layer and nothing else, this building doesn't collide with the floor-layer if terrain is set to collide with floor layer. But if the building have floor-layer and another layer, it is blocked as expected.
To demonstrate it I wrote a little mod with only the following code in it :
Code: Select all
local tiles = data.raw["tile"];
-- add floor layer to collision mask of all non minable tile (terrain mostly)
for name,item in pairs(tiles) do
if not item.minable then
if item.collision_mask then
table.insert(item.collision_mask, "floor-layer");
else
item.collision_mask = { "floor-layer"}
end;
end
end
data.raw["furnace"]["stone-furnace"].collision_mask = { "floor-layer"}
data.raw["furnace"]["steel-furnace"].collision_mask = { "player-layer"}
data.raw["furnace"]["electric-furnace"].collision_mask = { "floor-layer","player-layer"}
Using the mod provided as attachment. We obtain those result :
The stone furnace which have ONLY floor-layer in collision mask should collide with terrain, it is not. It does not collide with player, it's normal.
Steel furnace which have ONLY player-layer in collision mask collide with player but not terrain. It's normal, just showing that it's not player-layer that block placement in the next screenshot.
Electric furnace which have floor-later AND player-layer collide with terrain.
Expected behavior : stone surnace which have floor-layer in mask should not be placeable on terrain (as terrain block floor-layer with the mod) like the electric furnace.
Edit : In case you are wondering,if I try to place the stone furnace on the ground it succeed (it should not)