Skip to content

Commit 1a48c70

Browse files
committed
wall torches
1 parent 2a73b60 commit 1a48c70

File tree

3 files changed

+313
-184
lines changed

3 files changed

+313
-184
lines changed

Autoload/Slabset.gd

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ enum dir {
2424
func load_slabset():
2525
tng = []
2626
dat = []
27-
var CODETIME_START = OS.get_ticks_msec()
27+
CODETIME_START = OS.get_ticks_msec()
2828
var oGame = Nodelist.list["oGame"]
2929
var oMessage = Nodelist.list["oMessage"]
3030

Scenes/PlaceThingWithSlab.gd

+12-9
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,10 @@ func determine_if_middle(slabID, ownership, bitmask, surrID, surrOwner):
8686
return false
8787

8888
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
9293
return []
9394
# if slabVar >= Slabset.tng.size(): return -1 # Out of bounds, causes crash
9495
#
@@ -114,14 +115,16 @@ func prison_bar_bitmask(slabID, surrID):
114115
return bitmask
115116

116117
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)
118121

119122
if Slabs.data[ surrID[torchSide] ][Slabs.IS_SOLID] == true:
120123
torchSide = -1
121124

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
127130

0 commit comments

Comments
 (0)