change null to 0 in lighting/lighting_source.dm

This commit is contained in:
LetterJay
2016-12-25 02:30:04 -06:00
parent 1ced4344a4
commit b18e2848ae
6 changed files with 83 additions and 46 deletions

View File

@@ -53,7 +53,7 @@
T = get_step(new_turf, diagonal)
if (T) // In case we're on the map's border.
if (!T.corners)
T.corners = list(null, null, null, null)
T.corners = list(0,0,0,0)
masters[T] = diagonal
i = LIGHTING_CORNER_DIAGONAL.Find(turn(diagonal, 180))
@@ -63,7 +63,7 @@
T = get_step(new_turf, horizontal)
if (T) // Ditto.
if (!T.corners)
T.corners = list(null, null, null, null)
T.corners = list(0,0,0,0)
masters[T] = ((T.x > x) ? EAST : WEST) | ((T.y > y) ? NORTH : SOUTH) // Get the dir based on coordinates.
i = LIGHTING_CORNER_DIAGONAL.Find(turn(masters[T], 180))
@@ -73,7 +73,7 @@
T = get_step(new_turf, vertical)
if (T)
if (!T.corners)
T.corners = list(null, null, null, null)
T.corners = list(0,0,0,0)
masters[T] = ((T.x > x) ? EAST : WEST) | ((T.y > y) ? NORTH : SOUTH) // Get the dir based on coordinates.
i = LIGHTING_CORNER_DIAGONAL.Find(turn(masters[T], 180))

View File

@@ -262,10 +262,12 @@
effect_str.Cut()
/datum/light_source/proc/recalc_corner(var/datum/lighting_corner/C)
if (effect_str.Find(C)) // Already have one.
REMOVE_CORNER(C)
if(!C)
return
if (effect_str.Find(C)) // Already have one.
REMOVE_CORNER(C)
APPLY_CORNER(C)
APPLY_CORNER(C)
/datum/light_source/proc/smart_vis_update()
var/list/datum/lighting_corner/corners = list()

View File

@@ -105,7 +105,7 @@
/turf/proc/generate_missing_corners()
lighting_corners_initialised = TRUE
if (!corners)
corners = list(null, null, null, null)
corners = list(0,0,0,0)
for (var/i = 1 to 4)
if (corners[i]) // Already have a corner on this direction.
@@ -119,7 +119,7 @@
if (!lighting_corners_initialised)
if (!corners)
corners = list(null, null, null, null)
corners = list(0,0,0,0)
for (var/i = 1 to 4)
if (corners[i]) // Already have a corner on this direction.