Permalink
Browse files

Fixed placing objects on litter and doors next to litter

Bad copy paste
  • Loading branch information...
mugmuggy authored and TheCycoONE committed Nov 9, 2017
1 parent 5602a17 commit cc1d860440714557435ea241346bf858af5f5c28
Showing with 2 additions and 3 deletions.
  1. +1 −2 CorsixTH/Lua/dialogs/place_objects.lua
  2. +1 −1 CorsixTH/Lua/world.lua
@@ -665,9 +665,8 @@ function UIPlaceObjects:setBlueprintCell(x, y)
-- ignore placed object tile if it is shareable
if not tile.shareable and is_object_allowed then
-- Check 4: only one object per tile allowed original TH
local objchk = map:getCellFlags(xpos, ypos, flags)["thob"];
-- can build on litter and unoccupied tiles and only placeable if not on another objects passable footprint unless that too is a shareable tile
is_object_allowed = (objchk == 0 or objchk == 62) and world:isTileExclusivelyPassable(xpos, ypos, 10)
is_object_allowed = world:isTileExclusivelyPassable(xpos, ypos, 10)
end
-- Having checked if the tile is good set its blueprint appearance flag:
View
@@ -2718,7 +2718,7 @@ function World:isTileExclusivelyPassable(x, y, distance)
else
-- doors don't have a footprint but objects can't be built blocking them either
for _, footprint in pairs(o:getWalkableTiles()) do
if footprint[1] == x and footprint[2] == y then
if o.object_type and o.object_type.thob ~= 62 and footprint[1] == x and footprint[2] == y then
return false
end
end

0 comments on commit cc1d860

Please sign in to comment.