Adds lighting for air alarms and fire alarms

This commit is contained in:
mwerezak
2015-06-21 12:32:01 -04:00
parent 4b5899fa30
commit 1cb41db995
3 changed files with 50 additions and 35 deletions

View File

@@ -7,11 +7,19 @@
var/list/light_sources
/atom/proc/set_light(l_range, l_power, l_color)
if(l_power != null) light_power = l_power
if(l_range != null) light_range = l_range
if(l_color != null) light_color = l_color
. = 0 //make it less costly if nothing's changed
update_light()
if(l_power != null && l_power != light_power)
light_power = l_power
. = 1
if(l_range != null && l_range != light_range)
light_range = l_range
. = 1
if(l_color != null && l_color != light_color)
light_color = l_color
. = 1
if(.) update_light()
/atom/proc/update_light()
if(!light_power || !light_range)