@@ -86,9 +86,10 @@ func determine_if_middle(slabID, ownership, bitmask, surrID, surrOwner):
86
86
return false
87
87
88
88
func get_object (slabVar , subtile ):
89
- for objectStuff in Slabset .tng [slabVar ]:
90
- if subtile == objectStuff [2 ]:
91
- return objectStuff
89
+ if slabVar < Slabset .tng .size ():
90
+ for objectStuff in Slabset .tng [slabVar ]:
91
+ if subtile == objectStuff [2 ]:
92
+ return objectStuff
92
93
return []
93
94
# if slabVar >= Slabset.tng.size(): return -1 # Out of bounds, causes crash
94
95
#
@@ -114,14 +115,16 @@ func prison_bar_bitmask(slabID, surrID):
114
115
return bitmask
115
116
116
117
func torch_object_bitmask (xSlab , ySlab , surrID ):
117
- var torchSide = oSlabPlacement .calculate_torch_side (xSlab , ySlab )
118
+ var torchSide = oSlabPlacement .pick_torch_side (xSlab , ySlab , surrID )
119
+
120
+ print (torchSide )
118
121
119
122
if Slabs .data [ surrID [torchSide ] ][Slabs .IS_SOLID ] == true :
120
123
torchSide = - 1
121
124
122
- if torchSide == 0 : return 01 # s
123
- elif torchSide == 1 : return 02 # w
124
- elif torchSide == 2 : return 04 # n
125
- elif torchSide == 3 : return 08 # e
126
- elif torchSide == - 1 : return 0 # center
125
+ if torchSide == 0 : return 01 # south torch
126
+ elif torchSide == 1 : return 02 # west torch
127
+ elif torchSide == 2 : return 04 # north torch
128
+ elif torchSide == 3 : return 08 # east torch
129
+ elif torchSide == - 1 : return 0 # no torch
127
130
0 commit comments