Skip to content

Commit 98ba88c

Browse files
committed
never pick torch side that is facing towards room
1 parent c8c1011 commit 98ba88c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Scenes/SlabPlacement.gd

+4-2
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,8 @@ func calculate_torch_side(xSlab:int, ySlab:int, surrID):
525525
if slabAtDir == Slabs.CLAIMED_GROUND:
526526
return sporadicDir
527527
if Slabs.data[slabAtDir][Slabs.IS_SOLID] == false and Slabs.is_door(slabAtDir) == false:
528-
return sporadicDir
528+
if Slabs.rooms_that_have_walls.has(slabAtDir) == false:
529+
return sporadicDir
529530

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

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

0 commit comments

Comments
 (0)