Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions code/modules/lighting/lighting_corner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -349,19 +349,19 @@ var/global/list/REVERSE_LIGHTING_CORNER_DIAGONAL = list(0, 0, 0, 0, 3, 4, 0, 0,
var/Ti

if (!new_opacity)
for (;;)
if (Tcorn.t1 && (T = Tcorn.t1.below || GET_BELOW(Tcorn.t1)) && (T.above?.z_flags & ZM_ALLOW_LIGHTING))
while(TRUE)
if (Tcorn.t1 && (T = Tcorn.t1.below || GET_BELOW(Tcorn.t1)) && T.corners?[Tcorn.t1i] && (T.above?.z_flags & ZM_ALLOW_LIGHTING))
Ti = Tcorn.t1i
else if (Tcorn.t2 && (T = Tcorn.t2.below || GET_BELOW(Tcorn.t2)) && (T.above?.z_flags & ZM_ALLOW_LIGHTING))
else if (Tcorn.t2 && (T = Tcorn.t2.below || GET_BELOW(Tcorn.t2)) && T.corners?[Tcorn.t2i] && (T.above?.z_flags & ZM_ALLOW_LIGHTING))
Ti = Tcorn.t2i
else if (Tcorn.t3 && (T = Tcorn.t3.below || GET_BELOW(Tcorn.t3)) && (T.above?.z_flags & ZM_ALLOW_LIGHTING))
else if (Tcorn.t3 && (T = Tcorn.t3.below || GET_BELOW(Tcorn.t3)) && T.corners?[Tcorn.t3i] && (T.above?.z_flags & ZM_ALLOW_LIGHTING))
Ti = Tcorn.t3i
else if (Tcorn.t4 && (T = Tcorn.t4.below || GET_BELOW(Tcorn.t4)) && (T.above?.z_flags & ZM_ALLOW_LIGHTING))
else if (Tcorn.t4 && (T = Tcorn.t4.below || GET_BELOW(Tcorn.t4)) && T.corners?[Tcorn.t4i] && (T.above?.z_flags & ZM_ALLOW_LIGHTING))
Ti = Tcorn.t4i
else // Nothing above us that cares about below light.
else // Nothing above us that cares about below light.
break

Tcorn = T.corners[Ti]
Tcorn = T.corners?[Ti]
below_r += Tcorn.apparent_r
below_g += Tcorn.apparent_g
below_b += Tcorn.apparent_b
Expand All @@ -377,19 +377,19 @@ var/global/list/REVERSE_LIGHTING_CORNER_DIAGONAL = list(0, 0, 0, 0, 3, 4, 0, 0,
T = null
Tcorn = src

for (;;)
if (Tcorn.t1 && (T = Tcorn.t1.above || GET_ABOVE(Tcorn.t1)) && (T.z_flags & ZM_ALLOW_LIGHTING))
while(TRUE)
if (Tcorn.t1 && (T = Tcorn.t1.above || GET_ABOVE(Tcorn.t1)) && T.corners?[Tcorn.t1i] && (T.z_flags & ZM_ALLOW_LIGHTING))
Ti = Tcorn.t1i
else if (Tcorn.t2 && (T = Tcorn.t2.above || GET_ABOVE(Tcorn.t2)) && (T.z_flags & ZM_ALLOW_LIGHTING))
else if (Tcorn.t2 && (T = Tcorn.t2.above || GET_ABOVE(Tcorn.t2)) && T.corners?[Tcorn.t2i] && (T.z_flags & ZM_ALLOW_LIGHTING))
Ti = Tcorn.t2i
else if (Tcorn.t3 && (T = Tcorn.t3.above || GET_ABOVE(Tcorn.t3)) && (T.z_flags & ZM_ALLOW_LIGHTING))
else if (Tcorn.t3 && (T = Tcorn.t3.above || GET_ABOVE(Tcorn.t3)) && T.corners?[Tcorn.t3i] && (T.z_flags & ZM_ALLOW_LIGHTING))
Ti = Tcorn.t3i
else if (Tcorn.t4 && (T = Tcorn.t4.above || GET_ABOVE(Tcorn.t4)) && (T.z_flags & ZM_ALLOW_LIGHTING))
else if (Tcorn.t4 && (T = Tcorn.t4.above || GET_ABOVE(Tcorn.t4)) && T.corners?[Tcorn.t4i] && (T.z_flags & ZM_ALLOW_LIGHTING))
Ti = Tcorn.t4i
else // Nothing above us that cares about below light.
else // Nothing above us that cares about below light.
break

Tcorn = T.corners[Ti]
Tcorn = T.corners?[Ti]
Tcorn.below_r += apparent_r
Tcorn.below_g += apparent_g
Tcorn.below_b += apparent_b
Expand Down
Loading