Skip to content

Commit

Permalink
never pick torch side that is facing towards room
Browse files Browse the repository at this point in the history
  • Loading branch information
rainlizard committed Jun 5, 2024
1 parent c8c1011 commit 98ba88c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Scenes/SlabPlacement.gd
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,8 @@ func calculate_torch_side(xSlab:int, ySlab:int, surrID):
if slabAtDir == Slabs.CLAIMED_GROUND:
return sporadicDir
if Slabs.data[slabAtDir][Slabs.IS_SOLID] == false and Slabs.is_door(slabAtDir) == false:
return sporadicDir
if Slabs.rooms_that_have_walls.has(slabAtDir) == false:
return sporadicDir

# Create the directions array with the preference direction first
var directions = []
Expand All @@ -537,7 +538,8 @@ func calculate_torch_side(xSlab:int, ySlab:int, surrID):
for direction in directions: # Check each direction in the array
var slabAtDir = surrID[direction]
if Slabs.data[slabAtDir][Slabs.IS_SOLID] == false and Slabs.is_door(slabAtDir) == false:
return direction
if Slabs.rooms_that_have_walls.has(slabAtDir) == false:
return direction

return -1 # If all directions are solid or doors, return -1 for no torch placement

Expand Down

0 comments on commit 98ba88c

Please sign in to comment.